Lists and keys in React
React uses keys to identify list items across renders so reconciliation can preserve identity correctly.
- Keys must be stable and unique within the list
- Indexes can break identity when order changes
- Keys affect correctness as well as performance
Lists and keys in React