In react-native one can do:
const somePath = 'https://...'
<Image source={somePath} />
or
const somePath = 'https://...'
<Image source={{uri: somePath}} />
From what I understand about web addresses is that URIs are a superset of URLs and URNs.
Questions
- What are the potential problems associated with supplying a web address to
sourceas a URL? What are the potential problems associated with supplying a web address to
sourceas a URI?Which method of supplying an address of an image to
sourceis more accurate, safer, and future proof?
The first code example you provided won't work
In general general you should use the source prop to provide a local image like so
and the uri to display a remote image like so
You can also use the uri to display base64 image data
Read more about it in the documentation
https://facebook.github.io/react-native/docs/image.html#source