All jobs / Frontend / web developer / React

Frontend / web developer interview question · 0–1 years

Why does React warn about a missing key when you render a list?

The strongest answer

Keys let React match each rendered item to its previous version across renders, so reordering, inserting or deleting does not scramble state and DOM; a stable, unique id per item is the right key, not the array index

Why it works

Right. Identity across renders; the index breaks when the list changes order.

What a good answer covers

Answers that fall short

Who gets asked this

More React questions