mjmeintjes/boot-react-native

SimpleExampleApp: show how to use assets

Closed this issue · 1 comments

Add an example of using an image to SimpleExampleApp, as the process is not obvious.

You can use this macro to point to the file:

(defmacro static-img [filename]
  `(js/require ~(str "../../../app/imgs/" filename)))

Second, for reloading I always use defonced vars for images so the packager doesn't get confused.

Third, you need to make sure the imgs folder is in packager root (or use relative paths?) -- should verify this.