This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-05
Channels
- # bangalore-clj (1)
- # beginners (99)
- # boot (108)
- # cider (15)
- # clara (4)
- # cljs-dev (12)
- # cljsjs (37)
- # cljsrn (4)
- # clojure (110)
- # clojure-italy (2)
- # clojure-spec (12)
- # clojurescript (168)
- # cursive (1)
- # datomic (24)
- # graphql (6)
- # hoplon (5)
- # jobs-discuss (2)
- # keechma (21)
- # mount (5)
- # off-topic (140)
- # om (2)
- # parinfer (37)
- # planck (6)
- # re-frame (4)
- # reagent (9)
- # rum (2)
- # spacemacs (4)
My understanding is that when you use a reagent component like [foo]
it uses the react life cycle and when use one like (foo)
it doesn't. Is this true? If so, is there a way to map
a component over something and use the life-cycle version?
@captainlexington don't recall if map
works because I've been using for
for this for a long time
@captainlexington you can also use (into [some-component] (map ...)) for some cases
so you end up with a vector with your component for the life cycle, but you can use map to generate the args
(of course you could also change the function to take a lazy-seq as its only arg and get the same result)
@deadghost What's the pattern for using for
instead?
@captainlexington `(for [x [1 2 3]] ^{:key (str "comp-" x)} [component])`
@deadghost I'll give it a shot, thanks!