React · Senior · Question 5 of 75
What happens during hydration?
- ✓Correct answer: React attaches handlers and state to the HTML rendered by the server
- 2The server re-renders the page after every user click
- 3The browser re-downloads all the HTML and replaces the server markup with it
Explanation
hydrateRoot walks the existing DOM, renders components on the client and expects the same markup, so it can simply "bring it to life". Until hydration finishes, the UI is visible but not interactive. If the markup doesn't match, you get a hydration error and the subtree is re-rendered on the client.