Warning: Each child in a list should have a unique “key” prop – How to fix this react error?
<ul> {["Item1", "Item2", "Item3"].map(item => <li>{item}</li> )} </ul>
When creating a list in the UI from an array with JSX, you might get this error.
Warning: Each child in a list should have a unique "key" prop
To fix this we should add a key
prop to each child and to any of its’ children.
<ul> {["Item1", "Item2", "Item3"].map(item => <li key="{item}">{item}</li> )} </ul>