Warning: Each child in a list should have a unique "key" prop
When rendering a list with .map(), each element needs a stable, unique key so React can track items between renders.
Each child in a list should have a unique "key" propunique key propEncountered two children with the same key Meaning
Without keys (or with duplicate/unstable keys like array indexes on reorderable lists), React may reuse the wrong DOM nodes — causing inputs to keep wrong values or animations to glitch.
Common causes
- Missing
keyon the outermost element returned from map - Duplicate IDs in data
- Key placed on an inner element instead of the returned one
- Using index as key on lists that reorder/filter
⚡ Quick fix
- Add
key={item.id}to the element returned by map - Use stable IDs from your data, not Math.random()
- Put the key on the
<Fragment key=…>when returning fragments
Detailed fix by platform
React
- Example:jsx
{users.map(u => <UserRow key={u.id} user={u} />)}
How to diagnose
- Component — Which component renders the list (named in the warning)?
- Keys — Unique and stable?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Dynamic server usage Error: Dynamic server usage: Route /x couldn't be rendered statically because it used `cookies`
- Element type is invalid Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined
- Functions not valid as child Warning: Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render.
Most viewed in React
- React must be in scope ReferenceError: React is not defined / 'React' must be in scope when using JSX
- No QueryClient set Error: No QueryClient set, use QueryClientProvider to set one
- Functions cannot be passed Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server".
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 14 Oct 2026