Browser
Error: Objects are not valid as a React child (found: object with keys {…})
- What it means
- A component tried to print an entire data object or a raw `Date` directly on the page instead of a piece of text or a number.
- Likely causes
- Writing
{user}or{createdAt}in JSX instead of{user.name}or a formatted date string. - Forgetting
awaiton an async function, so a Promise object is passed into the JSX.
- Writing
- Prevention
- Type-check with TypeScript (
npm run typecheckortsc --noEmit) before previewing changes.
Copy for your agent
The page shows `Objects are not valid as a React child`. Find which component renders an object or Date directly in JSX and format it as text.
Was this page helpful?