react native - Error when add image to project -


i created project , added image in project root directory.

in index.android.js added:

when run react-native run android, error displayed:

error: bundling failed: "unable resolve module ./my-icon.png c:\\users\\ayala\\documents\\developer\\react\\brunodantas\\index.android.js: not resolve `c:\users\ayala\documents\developer\react\brunodantas\my-icon.png' folder: did not contain package, nor index file"

the problem path think code example missing. problem image not able found.

currently code believe?

<image source={require('./my-icon.png')} /> 

this means image should in same folder index.android.js i'm guessing it's not... need more information in order tell real problem is.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -