I am attempting to assign a default value to my Avatar component in React Native Elements as I do not have all the required icon files prepared. However, when I use the OR logic, it does not seem to work as expected. What is the correct approach to achieving this?
{sites.map((key) => {
return (
<Avatar
size={32}
containerStyle={{ margin: 0, padding: "0.1em" }}
rounded
source={
require("../../assets/" + utils.getPathName(key.properties.nameEN, "icon.png")) ||
require("../../assets/default/icon.png")
}
onPress={() => {
displayModal(key);
}}
/>
);
})}