I had same bug, a workaround was to give one a :keyfn but not the other one.
@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)
))))
like this....
@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.
yes, that's true, so, just wait the fixing...