Fork me on GitHub

@pesterhazy did you notice that someone replied to you after a few months ?


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)))


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}]) 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 †