tiensonqin / cljs-exponent

Exponent.js clojurescript bindings
Eclipse Public License 1.0
30 stars 5 forks source link

Cannot import Expo Components #5

Closed t4sk closed 6 years ago

t4sk commented 7 years ago

I cannot import Expo components, such as AppLoading. I found out that AppLoading is a module under Expo.Components.AppLoading (not Expo.AppLoading).

cljs.user=> (require '[cljs-exponent.reagent :as rn])
nil
rncljs.user=> rn/app-loading
nil

In case someone else is having the same issue, here is a work around.

(def Expo (js/require "expo"))
(def Components (.-Components Expo))
(def AppLoading (.-AppLoading Components))

(def app-loading (r/adapt-react-class AppLoading))
tiensonqin commented 6 years ago

Now it works, sorry for the late response.