Selective Hydration with Streaming
What you'll learn: How streaming SSR lets React hydrate components as their HTML arrives, without waiting for the entire page to load.
The Problem with Traditional Hydration
In traditional SSR, React waits for all the HTML to arrive before it starts hydrating anything. Even if your navigation bar's HTML arrives immediately, it sits there non-interactive while waiting for a slow product list to finish streaming. The entire page is frozen until hydration completes top-to-bottom.
How Selective Hydration Works
When you combine streaming SSR with Suspense boundaries, React gains a superpower: selective hydration. As soon as a component's HTML arrives and is inserted into the DOM, React can begin hydrating just that piece—independently of the rest of the page.
Think of it like a restaurant serving dishes as they're ready, not waiting for the entire table's order. Your appetizer (navigation) gets served and becomes interactive immediately, even while the kitchen is still preparing the main course (data table).
The Streaming + Suspense Combination
// As the shell HTML streams in, React hydrates it immediately
<nav>...</nav>
<Suspense fallback={<Spinner />}>
{/* When this HTML arrives later, React hydrates it separately */}
<SlowProductList />
</Suspense>
React hydrates the shell first. When <SlowProductList>'s HTML finally streams in and replaces the spinner, React hydrates just that component—without blocking or re-hydrating anything else.
Progressive Interactivity
Users can click buttons in your header while the rest of the page is still streaming in. Each Suspense boundary becomes an independent unit that hydrates when ready, creating a progressively interactive experience instead of an all-or-nothing freeze.
Key Takeaway: Selective hydration means React hydrates components individually as their streamed HTML arrives, making parts of your page interactive immediately instead of waiting for the entire page to finish loading and hydrating.