Hydration
ELI5 — The Vibe Check
Hydration is when a server-rendered HTML page comes alive in the browser. The server sends a static HTML snapshot — fast to load, good for SEO — then JavaScript downloads and 'hydrates' it by attaching event listeners and making it interactive. Like pouring water on a dehydrated app.
Real Talk
Hydration is the process of attaching JavaScript event handlers and reactive state to server-rendered HTML markup. After SSR sends static HTML to the client, the JS framework runs in the browser, traverses the existing DOM, and makes it interactive without rebuilding the entire tree from scratch.
Show Me The Code
// Nuxt / Next.js do this automatically
// Server: renders <button>0</button> as HTML
// Client: hydrates it so the click handler works
// If DOM mismatches between server and client → hydration mismatch error
When You'll Hear This
"You're getting a hydration mismatch because the server and client render different content." / "Partial hydration lets you hydrate only the interactive islands."
Related Terms
CSR (Client-Side Rendering)
CSR means the browser downloads a mostly-empty HTML page plus a big JavaScript bundle, then builds the full page in the browser.
Next.js
Next.js is React's big sibling that adds superpowers like SSR, SSG, file-based routing, and API routes.
Nuxt
Nuxt is Vue on steroids. It's a meta-framework that adds SSR, SSG, file-based routing, auto-imports, and a full deployment pipeline on top of Vue.
Render
Render is another developer-friendly hosting platform that does web services, databases, cron jobs, and static sites all in one place.
SSG (Static Site Generation)
SSG builds all your pages ahead of time — before anyone visits. You get a folder of plain HTML files that are blazing fast to serve from a CDN.
SSR (Server-Side Rendering)
SSR means the server builds your HTML before sending it to the user's browser.