React: 'Each child in a list should have a unique key prop'
@devsingh05▲ 5 net votes
When rendering arrays with map, give the outermost element of each item a key that is stable and unique among siblings, usually an id from the data: items.map(item => <Row key={item.id} ... />). Putting the key on an inner element, or using Math.random(), still triggers problems (the latter remounts every render). Fragments in lists need the long form <Fragment key={...}>.