3 ms·
Genuine question: what if you disable JavaScript and then load the page? Would you just get the SSR portion of the page and if it wasn't SSR at all then you'd g
by jjice 4y ago
Genuine question: what if you disable JavaScript and then load the page? Would you just get the SSR portion of the page and if it wasn't SSR at all then you'd get a blank page?
- dawnerd 4y agoHard to say since it depends(tm) but for the most part it should look like any other html site, react then just hydrates. IMO it's the best of both worlds. On the sites I've been working pages that have been server rendered work mostly perfectly with javascript disabled.
- ec109685 4y agoYou’re paying the price of initializing react twice and generating the dom: once on the serve side and then again on client before page is interactive.
- jayflux 4y agoNot 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