4 min read
•Question 7 of 48easyLists and Keys
Rendering lists efficiently in React.
Rendering Lists
Use JavaScript map() to transform arrays into lists of elements.
Why Keys Matter
Keys help React identify which items have changed, been added, or removed. They should be:
- Stable: Don't change between renders
- Unique: Among siblings
- Not indexes: Unless list is static