React key Prop Playground

The neighbourhood head’s row of puppets: Rara claps for Semar and writes a note, then Bagong is added in front or the row turned round, and an index, id or…

Why it matters

A wrong key is one of the most confusing React bugs: the data is right, yet the UI shows it in the wrong place (an input’s text, focus, an animation). Very common because an index "feels good enough", until the list is inserted into, reordered or filtered.

The key idea

A key is an item’s IDENTITY to React, not its place

Common mistakes

Try it in this playground