Fork me on GitHub
#shadow-cljs
<
2020-12-04
>
benny06:12:09

i tend to end up with errors like this in my release builds for our react native project. does this have to do with the :infer-externs flag?

E/unknown:ReactNative: MyAppImpl caught native exception
    com.facebook.react.common.JavascriptException: TypeError: u(BY).Il is not a function. (In 'u(BY).Il(q.a(n))', 'u(BY).Il' is undefined), stack:

thheller08:12:31

@benny yes, thats a typical externs error

benny20:12:04

is the solution for it to just change :infer-externs to false!?

thheller21:12:18

the solution is add ^js typehints where required. :infer-externs false just turns of the warnings. see https://shadow-cljs.github.io/docs/UsersGuide.html#infer-externs

defa09:12:09

With :target :react-native where would I put files to load on demand via (js/require "data.json")? Is there some assets/resource path to configure?

thheller12:12:36

in shadow-cljs no, in react-native I don't know. just js/require the file with a relative path to the output file

rkiouak12:12:39

I imagine with react native it would be similar to how fonts are bundled -- so i think something in both ios and android folders