Adjacent JSX elements React Origin: On your device OSI layer 7 · Application Last updated 14 Oct 2026

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.

Exact message you may see Adjacent JSX elements must be wrapped in an enclosing tagJSX expressions must have one parent element
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

  1. Wrap them in <>…</> (Fragment)
  2. Or a semantic wrapper element if styling needs it

Detailed fix by platform

React

  1. jsx
    return (
      <>
        <Header />
        <Main />
      </>
    );

How to diagnose

  1. Return — How many top-level elements?
  2. Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

🔧 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):

Could not Fast Refresh — [vite] hmr invalidate … Could not Fast Refresh. Export is incompatible. (React)Could not Fast RefreshElement is missing end tag — Vue: [plugin:vite:vue] Element is missing end tag. / Invalid end tag. (Vue)Element is missing en…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…GraphQL Syntax Error — GraphQL: Syntax Error: Expected Name, found <EOF> / Unexpected } (API)GraphQL Syntax ErrorInvalid DOM property — Warning: Invalid DOM property `class`. Did you mean `className`? (React)Invalid DOM propertyinvalid regex — SyntaxError: Invalid regular expression: /x/: Unterminated group (JavaScript)invalid regexkey 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 propMinified React error — Error: Minified React error #31; visit https://react.dev/errors/31 for the full message (React)Minified React errorAdjacent …

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.