This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-12
Channels
- # aleph (1)
- # announcements (1)
- # beginners (54)
- # calva (11)
- # clojure (55)
- # clojure-france (1)
- # clojure-italy (4)
- # clojure-spec (10)
- # clojure-uk (7)
- # clojurescript (3)
- # cursive (3)
- # data-science (8)
- # datomic (10)
- # emacs (1)
- # fulcro (21)
- # graalvm (2)
- # jobs (1)
- # kaocha (1)
- # nrepl (1)
- # nyc (1)
- # other-languages (5)
- # reitit (8)
- # rum (5)
- # shadow-cljs (84)
- # spacemacs (2)
- # sql (20)
- # testing (3)
- # vim (1)
Any recommendations for deeply threading values from the root to all child components? Specifically, I'm trying to pass a DataScript conn to mixins so that my components can add a mixin like ... (with-tx ::on-create-todo my-tx-fn)
@U9S3H9HAR have a look at react context: https://reactjs.org/docs/context.html
Static properties in rum work like this FYI:
(def MyContext (react/createContext))
(rum/defc my-component
< {:static-properties {:contextType MyContext}}
...)
That tripped me up when following that react guide.thanks! is that context API available in the version of React that rum provides?
Right now the workaround is simply referencing a globally shared reference to the conn atom from within the mixin