KnisterPeter / react-ssr-renderer

React server-side rendering without special APIs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-ssr-renderer

This project aims to do a server side rendering of a react application.

The difference to ReactDOMServer is the usage of jsdom to do a full render including data-fetching and other asynchronous operations without special apis.

How it works

The crucial part of the rendering is to decide when we are ready to send the html to the client.

This is done by rendering a node.js vm environment with a few wrapped global variables like Promises. We do track all asynchronous work and when nothing is left to do, we return the current rendered state.

About

React server-side rendering without special APIs

License:MIT License


Languages

Language:JavaScript 100.0%