Why does React warn against using array indices as `key` props in dynamic lists, and what actual UI bugs can happen if you ignore it?
When IS it completely safe to use an index as a key?
What the Rubric Checks
- • Explains how React matches Fiber nodes across renders via key
- • Gives concrete bug: wrong input state/focus staying attached after prepend/delete
- • Correctly states static, never-reordered lists as the safe exception
High-Scoring Answer Blueprint
React uses keys to match elements between renders. If items are inserted, deleted, or reordered, index keys shift and React reuses existing component instances for the wrong data — scrambling uncontrolled input values or animations. Index keys are only safe for static lists that never reorder or mutate.