Closed Jarrio closed 7 years ago
require
can be referenced as js.Lib.require
For the file path, I just think that is it not related to this project. Keep in mind that Haxe and this library only helps you to generate the js file. Everything else still follows the rules set by react native.
It seems like it uses the generated/<platform>
directory as the root. So I placed my image in bin/generated/android/0928.png
and it was loaded. I've only tested this in debug so I'm not sure if there will be any differences for a release build.
With the image code being:
<Image source={require("./0928.png")} />
Thanks!
This is not unexpected. require
resolves other files relative to the script itself.
I'm unfamiliar with javascript in general so this was not obvious, thanks for the help!
I can't seem to find a way to reference
require
which is mentioned in the react docs. It then proceeds to say that we should store images in the source code tree but what is the correct location for that in this project setup? The haxesrc
folder,generated
or the Android assets folder? I tried putting it in the assets folder and I can't seem to get the image to load after specifying the direct path and without?