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

Taught in

References