What is going on
Console warning: 'Each child in a list should have a unique key prop'. List re-renders cause wrong components to update. List items in wrong order after dynamic changes.
React uses keys to identify list items. Without unique keys, React reuses component instances incorrectly.
Error messages you might see
Common causes
- No key prop on list items
- Using index as key (breaks when list reorders)
- Key not unique across siblings
- Key changes on re-render
- Using Math.random() for key generation
How to fix it
Use unique, stable identifiers as keys:
// Bad - using index
{items.map((item, index) =>
{item.name}
)}
// Good - using unique ID
{items.map((item) =>
{item.name}
)}
// Good - using combination if no ID
{items.map((item) =>
{item.name}
)}Getting help takes about a minute
No hiring, no back and forth. A real person looks at your app.
-
1
Describe it
Tell us what you need in plain words. You don't have to be technical or have an account to start.
-
2
Free 15-minute call
A verified developer calls you. Many tasks are sorted right there, and it costs nothing.
-
3
Pay after you approve
If there is more to do, you get one fixed price up front. You pay only once you are happy.
Real people, reviewed by hand
Developers who do this every day
Every developer is approved by our team before they can take a task. Describe yours and the first one who is free picks it up.
Get helpQuestions
Why not use index as key?
Index changes when list reorders. React reuses wrong component instances. Only use index if list is static.
What makes a good key?
Unique, stable, not derived from other data. IDs from database are ideal. Avoid generating keys from data.