React — Interview Questions & Mental Models
Keys & lists
- Key tells React identity across reorders — must be stable among siblings.
- Don't use array index as key if the list can reorder/filter — wrong identity leads to state bugs and animation glitches.
- Keys are not passed as props to your component unless you duplicate them as a real prop.