News for hackers. Stuff that matters.
Re:Using React, Redux and SSR to acommodate users without Ja... by strogonoff on Sunday June 07, 2020 @08:04AM (#23446779)
For relatively simple use cases of server-side rendering with React, I think it’s worth knowing that you can render any component to static HTML with just one function call (and it works in Node environment). Another function call (this time browser-only) can be used to make the markup rendered interactive with no unnecessary DOM mutations.

React library makes these functions available from ReactDOMServer[0]. I like this API, it opens various possibilities and is easy to build on top of.

Of course, Daniel goes further to create a universal approach to authoring an app that not only supports SSR but works without JS entirely, which is pretty cool!

[0] https://reactjs.org/docs/react-dom-server.html#rendertostrin...

There are no comments on this comment yet.