madvas / cljs-react-material-ui

Clojurescript library for using material-ui.com
Eclipse Public License 1.0
205 stars 32 forks source link

Undefined react key #6

Closed alberto-portilla closed 8 years ago

alberto-portilla commented 8 years ago

Based on the example provided, i tried to use two components on the same parent as seen in the code:

(ui/mui-theme-provider
            {:mui-theme (ui/get-mui-theme
                          {:palette {:primary1-color (ui/color :amber600)
                                     :shadow-color   (ui/color :deep-orange900)
                                     :text-color     (ui/color :indigo900)}
                           :stepper {:inactive-icon-color  (ui/color :deep-orange900)
                                     :connector-line-color (ui/color :light-blue600)
                                     :text-color           (ui/color :teal900)
                                     :disabled-text-color  (ui/color :teal200)}})}
            (dom/div
              nil
              (my-stepper)
              (my-stepper)))

Doing this throws an error as the components are created with "undefined" react-key, causing the two elements to have the same key. Same happens when defining another component and using it.

madvas commented 8 years ago

This most likely isn't this library's problem, more likely it's Om.Next. As a temporary workaround u can still just wrap it in divs and everything's okay.

(dom/div
    nil
    (dom/div nil (my-stepper))
    (dom/div nil (my-stepper)))
alberto-portilla commented 8 years ago

True that, checked again and is an issue of om next, thanks on the heads-up