Based on React Native documentation, we should be able to fetch images from native resources.
This is works great on iOS, but in Android you can't load vector images using uri.
React Native version:
Steps To Reproduce
Placing vector image named image.xml in drawable folder and using this code, is not working:
<Image width={100} height={100} source={{ uri: 'image' }} style={{ width: 100, height: 100 }} />
Placing the vector image in assets folder and using this code, is not working either:
<Image width={100} height={100} source={{ uri: 'asset:/image.xml' }} style={{ width: 100, height: 100 }} />
Note that placing .jpg or .png images is working without any issues.
Based on React Native documentation, we should be able to fetch images from native resources.
This is works great on iOS, but in Android you can't load vector images using
uri.React Native version:
Steps To Reproduce
Placing vector image named
image.xmlindrawablefolder and using this code, is not working:<Image width={100} height={100} source={{ uri: 'image' }} style={{ width: 100, height: 100 }} />Placing the vector image in
assetsfolder and using this code, is not working either:<Image width={100} height={100} source={{ uri: 'asset:/image.xml' }} style={{ width: 100, height: 100 }} />Note that placing
.jpgor.pngimages is working without any issues.