Fork me on GitHub
#cljsrn
<
2019-05-28
>
xfyre16:05:40

@manu very basic approach:

(defonce NativeBase (js/require "native-base"))
; that's for a component
(defonce button (r/adapt-react-class (.-Button NativeBase)))
; that's for a function
(defonce Toast (.-Toast NativeBase))
(defn show-toast [args] (.show Toast (clj->js args)))

dotemacs19:05:18

@xfyre I think the issue here is not just that he needs to get the components, but that native base needs to run additional steps, which create native-base-theme directory in the root of the repo, which you’re meant to require additionally to just getting the components. See: https://clojurians.slack.com/archives/C0E1SN0NM/p1558989581017400?thread_ts=1558955085.015100&amp;cid=C0E1SN0NM

magomimmo23:05:40

@dotemacs have you really successfully required both ./native-base-theme/components and ./native-base-theme/variables/platform.js to set the style of StyleProvider? In my understanding those native-base stuff use some ES9 features and unless I'm outdated cljs is not able per se of requiring them.

dotemacs07:05:23

I did get get-theme required from what I quoted above, but I didn’t get variables directory required and figured since I’m not using this library, why spend time on it… I didn’t know about this limitation regarding ES9 features… Thanks

magomimmo08:05:07

You're welcome. Here is an hint, if someone needs it: https://clojurescript.org/guides/javascript-modules#custom-transforms

👍 4