Skip to content

Instantly share code, notes, and snippets.

@thecneu
Last active March 2, 2017 22:14
Show Gist options
  • Save thecneu/c81f7321a0c6d656e7e7cbebcdca9807 to your computer and use it in GitHub Desktop.
Save thecneu/c81f7321a0c6d656e7e7cbebcdca9807 to your computer and use it in GitHub Desktop.
hot reload
ReactDOM.render(
<App />,
rootEl
)
if (module.hot) {
module.hot.accept('./App', () => {
const NextApp = require('./App').default
ReactDOM.render(
<NextApp />,
rootEl
)
})
}
const configureStore = () => {
const store = createStore()
if (module.hot) {
module.hot.accept(() => {
const nextRootReducer = require('../reducers/index').default
store.replaceReducer(nextRootReducer)
})
}
return store
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment