Course contentsShow
← React
Lesson 1372 of 2,39634. Suspense FundamentalsFree lesson

No Fallback Prop: Error Thrown

Omitting the fallback prop causes React to throw an error; every Suspense boundary requires one.

No Fallback Prop: Error Thrown

What you'll learn: Why React throws an error if you forget the fallback prop on a Suspense boundary.

The Mandatory Requirement

The fallback prop isn't optional — it's required. If you create a <Suspense> boundary without providing a fallback, React will immediately throw an error during render:

// ❌ This throws an error
<Suspense>
  <LazyComponent />
</Suspense>

// Error: "A React component suspended while rendering, 
// but no fallback UI was specified."

Why React Enforces This

Think of Suspense like a safety net beneath a trapeze artist. Without the net (fallback), there's nowhere safe to land when something suspends. React can't leave the screen blank or show broken UI — it needs explicit instructions for what to display while waiting.

This design choice is intentional. React forces you to think about the loading experience upfront. There's no "default spinner" because every context is different: a profile card might want a skeleton, a route might show a full-page spinner, and a secondary widget might show nothing at all.

The Fix

Always provide a fallback:

// ✅ Valid Suspense boundary
<Suspense fallback={<div>Loading...</div>}>
  <LazyComponent />
</Suspense>

Even if you want minimal UI, you must be explicit:

<Suspense fallback={null}>
  <OptionalFeature />
</Suspense>

Key Takeaway: The fallback prop is mandatory on every <Suspense> boundary — React throws an error if omitted, forcing you to define the loading experience explicitly.