It looks elegant and it does get rid of the warning (which was the ‘real’ issue, right?). What is the danger here? Let me explain, a key is the only thing React uses to identify DOM elements. What…| Robin Pokorny
The map() method of Array instances creates a new array populated with the results of calling a provided function on every element in the calling array.| MDN Web Docs