Fork me on GitHub
#reagent
<
2017-10-19
>
axl31611:10:26

I’m using re-com and generating input boxes using a map over a collection of labels. But I get a react warning saying Every element in a seq should have a unique :key - I understand why the key is expected. I just don’t know how do I add it using re-com, hiccup etc. Anyone know?

pesterhazy12:10:24

normally the easiest is to add a prop like {:key some-unique-key}

gregg22:10:07

@aymat316 Here is an example of how we do it in re-com. It uses a for, but same thing should apply with map: https://github.com/Day8/re-com/blob/master/src/re_com/alert.cljs#L109-L120

axl31622:10:46

@gregg Great! thanks for sharing!