Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Sample application: Server-Side Rendering and Code Splitting with React-Router 4

The purpose of this repository is to showcase a working solution for a server-rendered, code-split app with React-Router 4. This solution is described in detail on my personal blog here.

Highlights are:

  • We use a simple HOC on the server, which allows us to know which chunks were involved in the render
  • We use a different HOC on the client which renders asynchronously
  • We switch between the two implementations using Webpack's NormalModuleReplacementPlugin
  • When rendering on the server, we send the list of necessary chunks down to the client
  • We load these chunks on the client before doing the initial render

Running the code

Should be as simple as cloning the repo and then running npm install && npm start.

License

MIT

About

No description, website, or topics provided.

Resources

Releases

No releases published

Packages

No packages published