Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?
A component returns two sibling JSX elements without a single parent.
Seen on:
React
Meaning
JSX compiles to one expression; two siblings need a wrapper element or a Fragment. TypeScript reports it as “JSX expressions must have one parent element”.
Common causes
- Returning sibling elements
- Conditional rendering with two elements side by side
⚡ Quick fix
- Wrap them in <>…</> (Fragment)
- Or a semantic wrapper element if styling needs it
Detailed fix by platform
React
- jsx
return ( <> <Header /> <Main /> </> );
How to diagnose
- Return — How many top-level elements?
- Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.
🧠 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026