Skip to content

Instantly share code, notes, and snippets.

@diegocasmo
Created February 20, 2017 15:23
Show Gist options
  • Save diegocasmo/be625f6dd4a12e2ed1eb3f713512ed96 to your computer and use it in GitHub Desktop.
Save diegocasmo/be625f6dd4a12e2ed1eb3f713512ed96 to your computer and use it in GitHub Desktop.
This file starts the application like you would normally do in the client side. It is wrapped by the Provider component and passes to it the appData received from the index.ejs file.
window['MY_APP'] = window['MY_APP'] || (() => {
return {
initialize: (config) => {
ReactDOM.render(
<Provider appData={config.appData}>
<Router history={browserHistory}>
{ routes }
</Router>
</Provider>,
document.getElementById('root')
);
}
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment