Chapter 12. React on the server and integrating React Router
This chapter covers
- Server-side rendering with React
- When to and when not to add server-side rendering to your application
- Transitioning your routing setup to React Router
- Handling authenticated routes with React Router
- Fetching data during server-side rendering
- Using Redux in the server-side rendering process
Did you know you can use React outside the browser? That’s because some parts of the react-dom library don’t require a browser environment to work and can run on the node.js runtime (or almost any JavaScript runtime with sufficient language support). To be fair, most JavaScript that isn’t platform-specific can run on the browser or server; that would exclude IO-related features like reading files or cryptography for the node.js platform and user-related events or DOM-related aspects for browser platforms. But with the robustness and prevalence of the node.js platform, more and more frameworks are starting to be written with server and browser support in mind.