atomicits/purescript-rnx

ImageSource doesn't work with Local paths

Closed this issue · 5 comments

Because the react native bundler will not pickup images referred via require() unless they are literally referenced in the javascript source, it's not possible to do this directly in purescript. The approach I took was to make ImageSource a foreign type, which allows you to put the require("image.png") in your .js files.

@doolse I am not clear about the use cases where we can set an array of uri's once I am clear I will merge the PR

I added a function for using an array, also changed the other one to use a record to make it clear what each parameter is

I guess its mainly because currently require() doesn't allow to use relative paths (outside output folder). Will work on this and update when we have a solution which is not breaking away from other code.

will use FFI to handle this