PlainError

Objects are not valid as a React child (found: object with keys {id, name}). If you meant to render a collection of chil

Last checked 2026-11-11 · 3 fixes · reviewed answer

TL;DRReact cannot display a plain JavaScript object inside JSX. The error shows you tried to render an object that has an id and name property directly as a child element.

Most likely cause: JSX expression is rendering a full object instead of a string, number, or mapped array of elements

Try first: Find the JSX line causing the error

Likely causes

  1. JSX expression is rendering a full object instead of a string, number, or mapped array of elementsmost likely
  2. Data meant for a list is being passed as a single object rather than an arraypossible
  3. Component is receiving an object prop and trying to render it without extracting values firstless likely

How to fix it

Safest first: SafeChanges settingsDangerous
  1. Find the JSX line causing the errorSafe

    Search your code for curly braces containing the variable that holds the object with id and name, such as {item} or {user}.

  2. Render a property instead of the whole objectSafe

    Change the expression to show only a primitive value, for example replace {item} with {item.name}.

  3. Convert an object to an array if rendering a listSafe

    If you intended to show multiple items, ensure the data is an array and use .map() to return JSX elements for each one.

If that didn't fix it

Add console.log around the variable you are rendering to inspect its exact value and type before the JSX line.

When to see a technician

If you are not comfortable editing React components, ask a developer to review the file where the error occurs.

Quick answers

What does Objects are not valid as a React child (found: object with keys {id, name}). If you meant to render a collection of chil mean?
React cannot display a plain JavaScript object inside JSX. The error shows you tried to render an object that has an id and name property directly as a child element.
What causes Objects are not valid as a React child (found: object with keys {id, name}). If you meant to render a collection of chil?
JSX expression is rendering a full object instead of a string, number, or mapped array of elements. (most likely) Data meant for a list is being passed as a single object rather than an array. (possible) Component is receiving an object prop and trying to render it without extracting values first. (less likely)
How do I fix Objects are not valid as a React child (found: object with keys {id, name}). If you meant to render a collection of chil?
Try these in order, safest first: 1. Find the JSX line causing the error. 2. Render a property instead of the whole object. 3. Convert an object to an array if rendering a list.
What if that didn't fix it?
Add console.log around the variable you are rendering to inspect its exact value and type before the JSX line.
When should I see a technician?
If you are not comfortable editing React components, ask a developer to review the file where the error occurs.
Did this fix it? Report a problem

Related errors

All Coding errors →