Skip to content

Latest commit

 

History

History
11 lines (6 loc) · 1.35 KB

README.md

File metadata and controls

11 lines (6 loc) · 1.35 KB

A vanilla and minimalist universal React server that mounts JSX into the entire DOM

A small example of how you could build a universal React app using vanilla React and the new React Router v4.

I mount React at the document so you use can use JSX the whole way down. No server template engine or html string interpolation needed. You also control the head content with React, therefore no document head manager such as react-helmet is needed.

Server side props are embedded into the server rendered HTML using JSX itself.

The transpiling of the React code for server side rendering is performed by babel-register, there is no server side bundle, and I only transpile the JS I have to.

One caveat with mounting at the document level could be 3rd party JS libraries needing to manipulate the DOM such as browser extensions or Google Analytics.