This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-08
Channels
- # aleph (2)
- # aws (1)
- # beginners (172)
- # boot (15)
- # cider (17)
- # clara (7)
- # cljs-dev (22)
- # cljsrn (12)
- # clojars (3)
- # clojure (110)
- # clojure-dev (5)
- # clojure-italy (13)
- # clojure-sanfrancisco (5)
- # clojure-spec (3)
- # clojure-uk (31)
- # clojurescript (110)
- # community-development (2)
- # cursive (16)
- # datomic (19)
- # docs (4)
- # emacs (49)
- # fulcro (24)
- # jobs (5)
- # keechma (2)
- # lein-figwheel (41)
- # leiningen (10)
- # luminus (4)
- # lumo (24)
- # mount (24)
- # numerical-computing (1)
- # off-topic (16)
- # om (4)
- # onyx (6)
- # parinfer (9)
- # planck (8)
- # re-frame (7)
- # reagent (6)
- # shadow-cljs (125)
- # sql (5)
- # test-check (9)
- # unrepl (6)
- # yada (5)
Until now, I've used this recipe for each JS component:
(defn adapt-class [class]
(when class
(r/adapt-react-class class)))
(defn get-class [module name]
(adapt-class (oops/oget+ module name)))
(defonce native-calendar (js/require "react-native-calendars"))
(def Calendar (get-class native-calendar "Calendar"))
But, some components are different, and require accessing the component by "default", rather than its name, e.g.:
(defonce native-calendar-strip (js/require "react-native-calendar-strip"))
(def CalendarStrip (get-class native-calendar-strip "default"))
What is this default
key, which is not mentioned in the component doc? Does JavaScript somehow try it automatically? Does this pattern occur often?@deg the default is the javascript export way for this lib. Look at the source and you will see it
Look at https://clojurians.slack.com/archives/C0E1SN0NM/p1517404924000223 that alert me
Thanks! Guess I've got to learn more es6 stuff! I plan to put together a tiny library that handles this stuff, once I have a bit more under my belt. It looks like most of the cljsrn projects I find online are duplicating tiny variations of the same things.
Great! I'll announce here when I start. I hope sometime next week. (Ping me then, too, if this has scrolled off Slack's history).
@U7V9HE682 I've started. Very little so far: just a skeleton and one macro. Way too early to announce anything. But I'd love to accept PRs if you have good stuff to contribute. https://github.com/deg/radon
I want to go through some of the existing projects on github, see what else other folks have done, and include whatever looks good. At the very least, loading components, managing styles, and console debug support. I want to do some cleanups... document what there is, and use best practices (e.g., almost everyone is improperly using aget on object properties). I want to get a little further on my toy project that uses this, and see what it needs.