This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-29
Channels
- # arachne (3)
- # bangalore-clj (6)
- # beginners (246)
- # boot (57)
- # business (1)
- # capetown (1)
- # cider (2)
- # clara (1)
- # cljsjs (36)
- # cljsrn (1)
- # clojure (150)
- # clojure-austin (4)
- # clojure-brasil (7)
- # clojure-china (2)
- # clojure-france (3)
- # clojure-greece (3)
- # clojure-japan (3)
- # clojure-russia (38)
- # clojure-spec (25)
- # clojure-uk (25)
- # clojurescript (320)
- # clojurex (1)
- # cursive (38)
- # datascript (48)
- # datomic (23)
- # emacs (29)
- # events (1)
- # funcool (2)
- # hoplon (64)
- # jobs (3)
- # luminus (10)
- # off-topic (26)
- # om (27)
- # om-next (1)
- # onyx (1)
- # parinfer (38)
- # perun (5)
- # planck (19)
- # re-frame (38)
- # reagent (19)
- # remote-jobs (1)
- # rum (2)
- # schema (2)
- # spacemacs (1)
- # specter (8)
- # test-check (10)
- # vim (7)
- # yada (14)
@mikethompson for the future, this is where you look for cljsjs stuff: http://cljsjs.github.io/ (or straight in the packages repo on github)
@martinklepsch thanks, yeah, I went off in the wrong direction. All clear now.
@martinklepsch is it worth submitting a PR to cljsjs for usage instructions like this? https://clojurians.slack.com/archives/reagent/p1480370785005662
@pesterhazy not sure where you'd put it but at the very least a note in the wiki would be a good idea I'd say
Or you could add the same info to all the react-* packages
@martinklepsch wiki sounds good
although part of the challenge is to find out which js global a cljsjs package exports
@pesterhazy I guess in that case it should be in the package readme
Could someone help me understand why I'm getting a warning about keys in this scenario? I'm trying to dispatch different reagent components based on a :type
in a map.
(defn comp-a []
(fn [args]
[:div
[:span "I am compa"]
args]))
(defmulti panels (fn [x] (:type x)))
(defmethod panels :component-a [_ & args] [comp-a args])
(defn main []
(fn []
[:div [panels {:type :component-a} [:h1 "Test"]]]))
Warning: Each child in an array or iterator should have a unique "key" prop.
well since i'm here, is there a best practice for mounting different components based on a type like in my example?
Hi! Lately i’ve played a little with reagent.core/wrap and i’ve been a bit frustrated that it was not reactive like others reagent "ref » types. So i’ve tried to write it myself. Is it a terrible idea? why? gist: https://gist.github.com/pbaille/6616353731efe5bfa00869c6338b03c7
@joshk, there are known gotchas with using defmethods as components
you could use a wrapper that calls the defmethod, or just do (panels ...)
instead of [panels ...]
tbh I never really understood what the issue with reagent+defmethods was
@joshk @pesterhazy is right - best to stay away from multimethods as components. See http://stackoverflow.com/a/33487691/5215391