Fork me on GitHub
#cljsrn
<
2017-11-10
>
yenda11:11:14

@pesterhazy did you notice that someone replied to you after a few months ? https://github.com/facebook/react-native/issues/9084

Quest18:11:20

So I had the problem of needing to require a node component (via npm require ... --save) that was using the new ES6 .default property in the require. I solved this with the below, but the .-default syntax seems a bit odd. Is there a better way to do this?

(def ReactNativeDrawerLayout (js/require "react-native-drawer-layout"))
(def drawer-layout (r/adapt-react-class (.-default ReactNativeDrawerLayout)))

Quest18:11:37

Did a little more poking around. Looks like CLJS introduced the :npm-deps option†, but trying to use it breaks re-natal's build process.

Error: Cannot find module 'AccessibilityInfo' from '/Users/quest/project/node_modules/react-native/Libraries/react-native'
    at /Users/quest/project/node_modules/resolve/lib/async.js:46:17
If this was working, then maybe the workaround off the below issue would be usable.
(:require ["material-ui/RaisedButton :refer (default) :rename {default RaisedButton}])
https://dev.clojure.org/jira/browse/CLJS-2376 Still no solution yet, but FYI for anyone else that runs into this. I suspect the solution has some complications, but I'm not familiar enough with Re-Natal to know † https://clojurescript.org/news/2017-07-12-clojurescript-is-not-an-island-integrating-node-modules