Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
at main 548 B view raw
1import React from 'react'; 2import { render, hydrate } from 'react-dom'; 3import { AppContainer } from 'react-hot-loader'; 4 5import App from './app'; 6 7export default App; 8 9// Render your app 10if (typeof document !== 'undefined') { 11 const renderMethod = module.hot ? render : hydrate; 12 const mount = Comp => { 13 renderMethod( 14 <AppContainer> 15 <Comp /> 16 </AppContainer>, 17 document.getElementById('root') 18 ); 19 }; 20 21 mount(App); 22 if (module.hot) { 23 module.hot.accept('./app', () => mount(require('./app').default)); 24 } 25}