What are keys in React lists and why are they important?

Whether you understand React's reconciliation identity tracking. Keys are unique identifiers that let React match items across renders, preserving DOM state and avoiding unnecessary recreation.
This checks if you know that keys give elements a stable identity during reconciliation. A strong answer defines keys as unique, stable identifiers assigned to list items; explains that React uses them to determine which items changed, moved, or were removed; and notes that correct keys preserve component state and avoid bugs. Treating keys as optional performance hints, defaulting to array indices without warning about order changes, or confusing keys with props.
Read the original → react.dev
- #react
- #reconciliation
- #keys
- #lists
- #interview
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.