Fork me on GitHub

is it me or component-did-update only has access to the old props ?


I'm trying to render an :option element with :home/room as the value, but only room is rendered in the UI. Is this because reagent resolves keywords with (name :home/room) whenever you try to use them as a visible value in the UI?


seems to be the case for [:div :elmer/hey] too


only hey is rendered


so I guess this is part of reagent's render functionality


hi. anyone know how to stop input to lose focus due to a re-rendering when you’re adding new elements to the parent (which also holds the key)?


Hi, Sometimes I feel a bit limited by the fact that Reagent requires :key props when a sequence is produced. In some cases it really seems like the nicest way of doing some things is to use the sequence library to create certain patterns. For example, consider a sequence of "breadcrumbs" separated by a (font-awesome) arrow: (interpose [:i {:class "fa fa-caret-right"}] (map (fn [crumb] [:span {:key crumb} crumb]) crumbs))


The above gives the Warning: Every element in a seq should have a unique :key: warning (since the arrow icons don't have :key attributes), which is quite annoying and forces me to use less nice ways of solving the problem. Anyone else annoyed by/have a way to deal with this?


@curlyfry is a pure css solution possible? a selector like .crumb + .crumb might work since your interposed element doesn't have any data


@curlyfry if you put your sequence into a [:div] then you will swerve the warning... it wouldn't be as performant for changes to a long sequence, but breadcrumbs are probably not going to be a very long sequence


@curlyfry, maybe you could use (gensym)? Something like (interpose [:i {:key (str (gensym)) :class "fa fa-caret-right"}] (map (fn [crumb] [:span {:key crumb} crumb]) ["home" "profile"]))


doh, or maybe not … because I think gensym will only get evaluated once 😅


@jjfine @mccraigmccraig @upgradingdave Thanks guys, will check it out tomorrow!