This post is a sample chapter from my upcoming book
How to render a ReactJS component isomorphically ?
The trick is in defaultProps and componentDidMount methods.
On the server, it fetches initial data as default props.
On client, it does nothing, but in componentDidMount method, it fetches the same data as the server side.
And you get isomorphic React component for free here!.
import React from 'react';
import AppState from...