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.

3m read timeFrom lo-victoria.com
Post cover image
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: index
2 Comments

Sort: