|
|
|
|
|
by redbar0n
1526 days ago
|
|
It is correct, except I think the browser generates the DOM from the HTML, and the JS just attaches event handlers to it. The reason for the double work is that the context here is SSR/SSG: «The re-execution of code on the client that the server already executed as part of SSR/SSG is what makes hydration pure overhead: that is, a duplication of work by the client that the server already did.» In client-side rendering (CSR), there isn’t double work in rendering the HTML, since the client only does it. Yes, the idea is to send pre-rendered HTML (by using SSR/SSG). The client doesn’t need to re-create the page/HTML, simply hydrate it (attach event handlers). But it is duplicate work and turns out to be a bit expensive to always do it on the initial load. Hope that helps to clarify. |
|