I'm trying to load image from Android's drawble resources library using React Native.
I tried to require it like this:
<Image source={require("image!some-image")} />
And:
<Image source={{uri: "some-image", isStatic: true}} />
But no luck.. I know that I can require image from the js path but in this case I need it from the 'res' folder.
There are three things that could possibly be wrong.
react-native run-android
). This should be done every time you add/modify an asset to the res folder3.There ought to be a ',' before isStatic.
<Image source={{uri: "some-image" isStatic: true}} />
. I'm guessing this was a typo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With