Hydration vs. Client-Side Rendering
What you'll learn: You'll understand the key differences between hydration and pure client-side rendering, and when each approach makes sense.
The Core Distinction
Both hydration and client-side rendering (CSR) involve JavaScript making a page interactive in the browser, but they start from very different places.
With pure CSR, the server sends a minimal HTML shell—often just a <div id="root"></div>—and JavaScript builds the entire UI from scratch in the browser. The user sees a blank page or loading spinner until all the JavaScript downloads, executes, and renders the content.
With hydration, the server sends fully-rendered HTML that users can see immediately. JavaScript then "wakes up" this static HTML, attaching event listeners and making it interactive. Think of it like a freeze-dried meal: CSR builds the meal from raw ingredients, while hydration just adds water to something already formed.
Performance Trade-offs
Hydration advantages:
- Faster First Contentful Paint (FCP) — users see content immediately
- Better perceived performance — something visible while JS loads
- Improved SEO — search engines see complete HTML
Hydration challenges:
- Longer Time to Interactive (TTI) — users see content they can't yet click
- Duplicate work — server renders, then client re-renders to hydrate
- Larger initial payload — both HTML and JavaScript
CSR advantages:
- Simpler architecture — no server rendering logic
- Lower server costs — just serves static files
- No hydration mismatch issues
CSR challenges:
- Slower FCP — blank page until JavaScript runs
- Poor SEO without workarounds
- Bad experience on slow networks or devices
Key Takeaway: Hydration prioritizes initial visibility (FCP) at the cost of delayed interactivity (TTI), while CSR keeps architecture simple but sacrifices immediate content visibility. Choose hydration when first impressions and SEO matter; choose CSR for admin tools or apps behind authentication where initial load speed is less critical.