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.
Seen on:
React
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 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