Fork me on GitHub
#rum
<
2019-10-12
>
Sam Ferrell21:10:48

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)

cjsauer21:10:41

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.

Sam Ferrell15:10:29

thanks! is that context API available in the version of React that rum provides?

Sam Ferrell21:10:23

Right now the workaround is simply referencing a globally shared reference to the conn atom from within the mixin