Published on

What is hydration in react?

Authors
  • avatar
    Name
    Gene Zhang
    Twitter

@WizzinWig on Reddit:

Dan Abramov writes it as: “It’s like watering the “dry” HTML with the “water” of interactivity and event handlers.”

The server sends the client HTML along with a link to the JS to download. The JS gets downloaded and then “hydrates” the page taking it from a plain page to one with interactivity meaning adding handlers to buttons, events to elements on the page like onClick and so forth.