Error: Nothing was returned from render. This usually means a return statement is missing.
A component returned undefined (React 17 and earlier) — usually a missing return or a return followed by a line break.
Nothing was returned from renderThis usually means a return statement is missing Meaning
Arrow functions with braces need an explicit return. A bare return followed by JSX on the next line returns undefined (automatic semicolon insertion). React 18 allows undefined but you’ll render nothing.
Common causes
- Missing return in a function with braces
- return followed by a newline before the JSX
- Conditional branch without a return
⚡ Quick fix
- Return JSX explicitly or use parentheses: return ( <div/> )
- Return null for "render nothing"
Detailed fix by platform
React
- jsx
function Card() { return ( <div className="card" /> ); }
How to diagnose
- Component — Which one is named?
- Paths — Does every branch return?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Adjacent JSX elements Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?
- Element 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
- 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.
Most viewed in React
- Functions cannot be passed Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server".
- No QueryClient set Error: No QueryClient set, use QueryClientProvider to set one
- Module parse failed Module parse failed: Unexpected token. You may need an appropriate loader to handle this file type
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Report a correction or suggest an improvement
Last updated 13 Oct 2026