I'm trying to display a local image in my react native app. The docs say the way that you do this is by doing something like
<Image source={require('./my-icon.png')} />;
This works on its own, however I'm trying to pass this in as conditional logic if the api I'm getting data back from has a null url object.
<Image source={{uri: article.urlToImage || require("./awaiting.png")}}/>
When I do this I'm getting 'JSON value of '1' of type NSNumber cannot be converted to a valid URL'.
It seems to not like a combination of
<Image source={{uri: article.urlToImage }}/>
and
<Image source={require('./awaiting.png')} />
Can anyone help?
Thanks