April 2020
Intermediate to advanced
716 pages
18h 55m
English
To implement basic server-side rendering, we will need to import the following React, React Router, and Material-UI-specific modules into the server code. In our code structure, the following modules will be imported into server/express.js:
import React from 'react'import ReactDOMServer from 'react-dom/server'
Router modules: StaticRouter is a stateless router that takes the requested URL to match with the frontend route which was declared in the MainRouter component. The MainRouter is the root component in our frontend.
import StaticRouter from 'react-router-dom/StaticRouter'import MainRouter from ...