This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-10
Channels
- # aleph (4)
- # aws (2)
- # bangalore-clj (2)
- # beginners (84)
- # boot (25)
- # cider (3)
- # cljsrn (3)
- # clojure (57)
- # clojure-italy (5)
- # clojure-losangeles (3)
- # clojure-russia (7)
- # clojure-spec (18)
- # clojure-uk (29)
- # clojurescript (90)
- # cursive (11)
- # data-science (68)
- # datascript (2)
- # datomic (25)
- # duct (3)
- # fulcro (13)
- # graphql (7)
- # immutant (1)
- # jobs (1)
- # leiningen (12)
- # lumo (1)
- # off-topic (51)
- # om (43)
- # onyx (15)
- # parinfer (10)
- # pedestal (4)
- # re-frame (7)
- # reagent (42)
- # ring-swagger (42)
- # rum (1)
- # shadow-cljs (172)
- # spacemacs (10)
- # specter (4)
- # sql (4)
- # test-check (19)
- # unrepl (54)
- # yada (3)
@pesterhazy did you notice that someone replied to you after a few months ? https://github.com/facebook/react-native/issues/9084
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}])
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