Created
August 4, 2017 13:47
-
-
Save mycolaos/57f7f424033ba8703af74510c344afe3 to your computer and use it in GitHub Desktop.
React Hot Loader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AppContainer } from 'react-hot-loader'; | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import Root from './Root.dev'; | |
import configureStore from './store/configureStore.dev' | |
const store = configureStore() | |
const rootEl = document.getElementById('root'); | |
const render = Component => | |
ReactDOM.render( | |
<AppContainer> | |
<Component store={store} /> | |
</AppContainer>, | |
rootEl | |
); | |
render(Root) | |
if (module.hot) module.hot.accept('./Root.dev', () => { | |
render(Root) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment