Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Server Side rendering is rerendered in frontend?

in this isomorphic example https://github.com/DavidWells/isomorphic-react-example he shows Server Side Rendering by disabling Javascript. But if javascript IS enabled in frontend, is it rendered again?

I did a small test by putting a console.log in the render function and it logs in the NodeJS console but also in the browser's console.

Is react intelligent enough to not rerender if the HTML comes from the server?

like image 436
davibq Avatar asked Nov 25 '25 18:11

davibq


1 Answers

It will render again in the sense that all of the React Component render functions will run again. It will not necessarily change the DOM at all however because React's diffing algorithm will not do anything if the correct DOM nodes are already in the page.

like image 197
loganfsmyth Avatar answered Nov 27 '25 07:11

loganfsmyth



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!