import React from 'react' ; import ReactDOM from 'react-dom' ; import { Provider } from 'react-redux' ; import { ConnectedRouter } from 'react-router-redux' ; import configureStore from './store' ; import 'sanitize.css/sanitize.css' ; import FontFaceObserver from 'fontfaceobserver' ; import createHistory from 'history/createBrowserHistory' ; import App from './containers/App' ; const openSansObserver = new FontFaceObserver ( 'Noto Sans' , { } ) ; openSansObserver . load ( ) . then ( ( ) => { document . body . classList . add ( 'fontLoaded' ) ; } , ( ) => { document . body . classList . remove ( 'fontLoaded' ) ; } ) ; const initialState = { } ; const history = createHistory ( ) ; const store = configureStore ( initialState , history ) ; const MOUNT_NODE = document . getElementById ( 'app' ) ; const render = ( Content ) => { ReactDOM . render ( < Provider store = { store } > < ConnectedRouter history = { history } > < Content /> < /ConnectedRouter> < /Provider>, MOUNT_NODE); } ; render ( App ) ; if ( process . env . NODE_ENV === 'production' ) { require ( 'offline-plugin/runtime' ) . install ( ) ; } if ( module . hot ) { module . hot . accept ( [ './containers/App' ] , ( ) => { ReactDOM . unmountComponentAtNode ( MOUNT_NODE ) ; render ( require ( './containers/App' ) . default ) ; } ) ; }