The is a skeleton for server-side rendering with ReactJS using react-router v4
- To install the dependancies:
yarn install - To compile the react code:
yarn setup - To run the app:
yarn start
- The react entry point is defined in the webpack config and lives in
./app/client.jsx. client.jscontains the id of the element in the index.html where the components will render.app-routeusesreact-router-configand calls the renderRoutes method while passing the routes props.routessets up the routing of the app. The path is assigned a component which is rendered when the route is called.app.jscombines the express routes with the react-router. The react components are rendered to a string and then passed to the template using the res.locals.