This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-28
Channels
- # aws (7)
- # beginners (69)
- # boot (67)
- # cider (9)
- # cljs-dev (159)
- # cljsrn (2)
- # clojars (25)
- # clojure (345)
- # clojure-austin (9)
- # clojure-berlin (1)
- # clojure-dusseldorf (10)
- # clojure-italy (3)
- # clojure-nl (1)
- # clojure-portugal (1)
- # clojure-spec (73)
- # clojure-uk (59)
- # clojurescript (163)
- # clojurewerkz (1)
- # component (26)
- # core-matrix (2)
- # cursive (20)
- # datascript (32)
- # datomic (15)
- # dirac (16)
- # emacs (3)
- # hoplon (35)
- # jobs-discuss (87)
- # jobs-rus (95)
- # luminus (15)
- # om (135)
- # om-next (3)
- # onyx (47)
- # pedestal (67)
- # perun (74)
- # play-clj (4)
- # portland-or (1)
- # proton (4)
- # re-frame (13)
- # reagent (18)
- # remote-jobs (17)
- # rum (20)
- # specter (11)
- # untangled (101)
- # yada (18)
Has anyone ever received the following error when using advanced compilation and rum:
Uncaught TypeError: Cannot read property ':rum/initial-state' of undefined
I’m guessing it’s a lack of externs for a library I recently included, but thought I would ask
For some reason this
is the window object instead of the component:
https://github.com/tonsky/rum/blob/e9cf678ddca85cae51ec45985d6b2be92e47315b/src/rum/core.cljs#L38-L46
What’s the best way to pass multiple children to a rum component? It’s easy to do one
use a vector
(gallery-panel [image1 image2])
probably you need to convert it to js array
(test-cmp [[:.first "qwerqwer"] [:.second "12312313"]])
For me it’s the following:
(rum/defcs rich-render < (rum/local false)
{:did-mount (fn [state]
(reset! (:rum/local state) true)
state)}
[state comps]
(let [{[rich & r-args] :rich
[simplified & s-args] :simplified} comps]
(if @(:rum/local state)
(apply rich r-args)
(apply simplified s-args))))
(defn gallery-image [src]
(rich-render {:simplified [pending-image src]
:rich [image-with-load-status src]}))
(rum/defc gallery-panel [children]
[:div.type.type-one
children])
(gallery-panel [(gallery-image <src>) (gallery-image <src>)])
it's okay for react and should be okay for rum