Each child in a list should have a unique “key” prop. Keys serve as identification for an element just like how passports are used to identify people. Keys should be a unique identifier so that each element can be identified properly. It is recommended to use some uniquely generated keys as the key to a dynamically rendered list.
Table of contents
What are React Keys?Why do we need it?The Right Way to Use Keys: idThe NOT Right Way to Use Keys: index2 Comments
Sort: