The Streaming SSR Connection
You'll learn how Suspense boundaries enable React to stream server-rendered HTML in chunks and hydrate components out-of-order, rather than waiting for everything at once.
The Problem with Traditional SSR
In classic server-side rendering, the server must wait for all data to load before sending any HTML. Then the client must wait for all JavaScript to load before any interactivity works. If one slow database query holds up the server, or one heavy component blocks hydration, the entire page waits.
How Suspense Enables Streaming
Suspense boundaries create natural "split points" in your React tree. When the server encounters a suspended component (one waiting for data), it:
- Immediately sends the HTML for everything outside that boundary
- Streams in the suspended component's HTML once its data resolves
- Inlines a small
<script>tag that tells the browser where to insert it
The browser displays the initial HTML right away, then progressively receives the rest. No all-or-nothing waiting.
Selective Hydration: The Client Side
On the client, Suspense boundaries enable selective hydration. React doesn't wait for the entire page's JavaScript to load and execute. Instead:
- Components can hydrate as their code arrives
- User interactions (like clicks) prioritize hydrating that component first
- Slow-loading sections don't block fast ones
Think of it like a restaurant serving dishes as they're ready, not waiting until every diner's meal is prepared.
Framework Integration
This streaming behavior is automatic when using frameworks with Suspense-aware SSR (Next.js App Router, Remix with deferred data). The framework wraps async data fetches in Suspense boundaries, and React handles the streaming protocol.
Key Takeaway: Suspense boundaries aren't just loading states—they're architectural markers that let React stream HTML from the server incrementally and hydrate the client out-of-order, eliminating all-or-nothing bottlenecks in SSR apps.