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

Fallback Scope: What Gets Replaced

The fallback replaces all children of the Suspense boundary, not individual suspended components.

Fallback Scope: What Gets Replaced

You'll learn: How Suspense boundaries determine which content gets replaced by the fallback UI when any component suspends.

The All-or-Nothing Rule

When any component inside a Suspense boundary suspends (throws a promise), React doesn't surgically replace just that one component. Instead, the entire set of children within that Suspense boundary gets replaced by the fallback.

Think of it like a curtain falling over a stage. When one actor isn't ready, the whole scene gets hidden behind the curtain—not just that one actor's spotlight.

What This Means in Practice

<Suspense fallback={<Spinner />}>
  <Header />
  <UserProfile />  {/* This suspends */}
  <ActivityFeed />
</Suspense>

When UserProfile suspends, you don't see <Header /> and <ActivityFeed /> with a spinner where UserProfile should be. You see only <Spinner />. All three components vanish until UserProfile is ready.

Why It Works This Way

This design prevents "popcorn UI"—where parts of the screen pop in and out unpredictably. React treats the boundary as an atomic loading unit. Either everything inside is ready, or you see the fallback.

If you want more granular control (showing some components while others load), you need nested Suspense boundaries around the specific components that should suspend independently.

Key Takeaway: The Suspense fallback replaces all children of the boundary as a single unit—not just the component that suspended.