Fork me on GitHub
#shadow-cljs
<
2021-10-29
>
Andrew Rudenko09:10:14

Hi! I have two compilation targets: :app (:react-native) :web (:browser) :app then goes to expo which compiles for ios, android and web Everything works like a charm. The problem is when I'm trying to use some components from an :app (react native components) in :web target, I'm getting errors like:

Errors encountered while trying to parse file
  node_modules/react-native/index.js
  {:line 14, :column 7, :message "cannot use keyword 'typeof' here."}
I do not quite understand what shadow-cljs target :react-native is doing, then what expo does to make it's working on the web, so it's hard for me to understand what I'm doing wrong. Did someone have a similar setup? Or maybe there are examples / blog posts about shadow-cljs/RN/web? Thank you

thheller16:10:29

@rudenkoco react-native packages are not directly usable in the browser so you cannot import those packages in a :browser build

thheller16:10:22

not sure what exactly expo does either but I guess it rewrites the react-native requires to something else