unique key prop React Origin: On your device OSI layer 7 · Application Last updated 14 Oct 2026

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.

Exact message you may see Each child in a list should have a unique "key" propunique key propEncountered two children with the same key
Seen on: React

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 key on 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

  1. Add key={item.id} to the element returned by map
  2. Use stable IDs from your data, not Math.random()
  3. Put the key on the <Fragment key=…> when returning fragments

Detailed fix by platform

React

  1. Example:
    jsx
    {users.map(u => <UserRow key={u.id} user={u} />)}

How to diagnose

  1. Component — Which component renders the list (named in the warning)?
  2. 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:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

Dynamic server usage — Error: Dynamic server usage: Route /x couldn't be rendered statically because it used `cookies` (React)Dynamic server usageElement 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 (React)Element type is inval…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. (React)Functions not valid a…IndexError — IndexError: list index out of range (Python)IndexErrorkey is not a prop — Warning: `key` is not a prop. Trying to access it will result in `undefined` being returned. (React)key is not a propNothing was returned from render — Error: Nothing was returned from render. This usually means a return statement is missing. (React)Nothing was returned …Objects are not valid as a React child — Error: Objects are not valid as a React child (React)Objects are not valid…setState during render — Warning: Cannot update a component (`Parent`) while rendering a different component (`Child`) (React)setState during renderunique ke…

Explore the map of this error Full error map →

🧠 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.