3 ms·
Not quite, the second time doesn’t “generate the dom”, it just hydrates, fills in the gaps and binds event listeners. It’s not starting from scratch and isn’t a
by jayflux 4y ago
Not quite, the second time doesn’t “generate the dom”, it just hydrates, fills in the gaps and binds event listeners. It’s not starting from scratch and isn’t a big cost.
- ec109685 4y agoIt generates the shadow dom is what I meant.
- v0idzer0 4y agoThere’s no DOM on the server and you only generate it once on the client. 1) The server generates html (a string). 2) Browser receives html and builds DOM just like in any static website 3) Javascript downloads and react sees the DOM already exists and does nothing