This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-20
Channels
- # aleph (2)
- # boot (18)
- # cider (3)
- # cljs-dev (14)
- # cljsrn (28)
- # clojure (428)
- # clojure-austin (3)
- # clojure-hk (1)
- # clojure-ireland (5)
- # clojure-mexico (1)
- # clojure-quebec (2)
- # clojure-russia (49)
- # clojure-spec (138)
- # clojure-uk (45)
- # clojurescript (70)
- # core-async (1)
- # cursive (8)
- # datomic (13)
- # defnpodcast (3)
- # devops (1)
- # editors (4)
- # events (1)
- # funcool (14)
- # hoplon (17)
- # jobs-rus (1)
- # luminus (5)
- # mount (51)
- # off-topic (21)
- # om (9)
- # om-next (8)
- # onyx (43)
- # planck (6)
- # re-frame (13)
- # reagent (18)
- # ring-swagger (1)
- # spacemacs (17)
- # untangled (18)
- # vim (13)
- # yada (21)
@mpisanko: thanks, I tried but it does not work. I tried to create two simple components with defui which just contains a div node with a string, and gave them a simple react-key. Then add them to the rootnode, but the warning msg still came out.
(defui Test1
Object
(render [this]
(dom/div nil
(dom/span nil "ss"))))
(def test1 (om/factory Test1 {:keyfn :test1}))
(defui Test2
Object
(render [this]
(dom/div nil
(dom/span nil "s2s"))))
(def test2 (om/factory Test2 {:keyfn :test2}))
(defui Dashboard
static om/IQuery
(query [this]
[{:dashboard/items (om/get-query DashboardItem)}])
Object
(render [this]
(let [{:keys [dashboard/items]} (om/props this)]
(dom/ul
#js {:style #js {:padding 0}}
(test1)
(test2)
; (map dashboard-item items)
))))
@joseph: as the doco says :keyfn should produce the key for component from its properties - an example can be found here: https://github.com/omcljs/om/wiki/Components,-Identity-&-Normalization#something-to-look-at
yes, right, but does it mean I have to give the :keyfn as react-key for each component, why the others examples like this https://github.com/omcljs/om/wiki/Queries-With-Unions do not apply the :keyfn
hmm, also there’s a bug: https://github.com/omcljs/om/issues/673 seems like you’re hitting it.