React Hot Reload with Redux React Hot Reload with Redux reactjs reactjs

React Hot Reload with Redux


After further research, it turns out the problem was due to the scope of the accept call in boot.js. Since it was essentially watching EVERYTHING from the root level app, the entire app was reloaded on a reducer change, thus the reducer's HMR accept was never called. Below is the working version.

boot.js

if (module.hot) {    module.hot.accept('./containers/App.js', () => {        const nextApp = require('./containers/App').default;        renderApp(nextApp);    })}

configureStore.js

  if (module.hot) {    module.hot.accept('../services/rootReducer', () => {      const nextRootReducer = require('../services/rootReducer');      const finalReducer = {...nextRootReducer, router: routerReducer };      store.replaceReducer(combineReducers(finalReducer));    })  }