Server-side rendering (SSR) is a method in which the HTML of a web page is produced on the server and transmitted to the client. This facilitates expedited initial page loads and enhances SEO, as the content is readily accessible upon page loading.
Hydration procedure - related with SSR
Hydration is the procedure that occurs subsequent to the transmission of server-side rendered HTML to the client. React transforms static HTML by "hydrating" it through the attachment of event listeners and the initialization of state, so rendering the page interactive. This procedure involves:
- React runs on the HTML produced by the server; it does not re-render it from scratch.
- React adds the required event listeners to the current HTML elements.
- React sets the component state and properties to start the page dynamic.