Skip to content
BENIBIX Learn

Hydration

Development🌐 Web DevelopmentRendering

Also known as Client Hydration, Rehydration

Browser code takes over a page the server built. Then its buttons work.

Think of it like

Think of it like a paper plant that comes to life when you add water. It looked right, and now it can move.

Example

Lucy opens a product page. She can read it at once, and half a second later, hydration makes the Add to Cart button work.

Why it matters

Hydration gives you a fast first view and a working app. Most modern frameworks rely on it.

Definition

Hydration is when browser code takes over a page the server built. The HTML arrives ready to read, but its buttons do nothing yet. Then the framework's code loads. It hooks up the event handlers and rebuilds its state. After that, the page works like a normal app. If the browser and the server draw the page in different ways, the framework shows an error.

Common mistake

Showing one thing on the server and another in the browser, like the time. This is called a hydration mismatch.

Key takeaways

  1. 1
    Server builds first. HTML arrives ready to read.
  2. 2
    Browser takes over. Code wires up the buttons.
  3. 3
    Must match. Both sides must render the same.