By Paul Scanlon
How to Build a Server-Side React App Using Vite and Express
A demo of server-side rendering and server-side data fetching without using a framework — showing what React-powered frameworks actually do.
In this post I’ll explain how you can enable server-side rendering and server-side data fetching in React… without using a framework!
Whilst the code in this post isn’t what I’d call “production ready”, it should help explain two of React’s built-in methods,hydrateRoot and renderToString, both of which are required to enable server-side rendering in React.
If you’re keen to jump ahead, all the code used in this post can be seen in the following GitHub repository.