hydration
The step where React in the browser attaches event handlers and state to HTML that was already rendered on the server.
In more detail
If the browser's first render does not match the server's HTML, React reports a hydration error. IDs generated with useId stay the same on both sides to avoid such mismatches.
Example
React reports mismatches in development and re-renders the affected part on the client.Related terms
- server rendering — Turning React components into an HTML string on a server or in a script, instead of drawing them in a browser.
- useId — The React hook that generates a unique ID string that is stable across renders and matches between server and browser.
- 'use client' — A string placed at the top of a file that marks its components as client components, sent to and run in the browser.
- Client Component — A component whose code is also sent to the browser so it can use state, effects and event handlers.
- server-side rendering — Building a page’s HTML on the server for each request, so the browser can show content before any JavaScript runs.
- DOM — The tree of objects a browser builds from a web page, which scripts read and change to update what is on screen.
- createRoot — The React DOM function that turns a page element into a React root, whose render method then displays a component inside it.
Taught in
- Component Packaging: Dual ESM/CJS Builds & Package Exports — Design Systems & Component Engineering
- App Router Architecture: Server-First Paradigms — Next.js 15 & Modern App Router Architecture
- Client Components: use client & Hydration Models — Next.js 15 & Modern App Router Architecture
- Component Tree Composition: Interleaving RSC & Client — Next.js 15 & Modern App Router Architecture
- Server Actions: use server Directives & Mutations — Next.js 15 & Modern App Router Architecture
- Image & Font Optimization: Zero Layout Shift Assets — Next.js 15 & Modern App Router Architecture
- Script Optimization: next/script & Lazy Third Parties — Next.js 15 & Modern App Router Architecture
- useSyncExternalStore: Tearing-Free Store Subscriptions — React 19 & Modern Component Architecture
- useId: Generating Stable Accessible Form Element Identifiers — React 19 & Modern Component Architecture
- useActionState: Async Action Handlers And Pending States — React 19 & Modern Component Architecture