om-next

2016-07-20T07:08:57.000009Z

I had same bug, a workaround was to give one a :keyfn but not the other one.

joseph 2016-07-20T07:27:36.000010Z

@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.

joseph 2016-07-20T07:27:58.000011Z

(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 2016-07-20T07:28:07.000012Z

like this....

mpisanko 2016-07-20T08:44:31.000013Z

@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

joseph 2016-07-20T09:19:08.000015Z

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

mpisanko 2016-07-20T09:32:30.000017Z

hmm, also there’s a bug: https://github.com/omcljs/om/issues/673 seems like you’re hitting it.

joseph 2016-07-20T11:34:07.000019Z

yes, that's true, so, just wait the fixing...