Closed shem86 closed 8 years ago
not sure, I've removed HMR from my apps entirely, seems buggy and I don't have the time to fix that stuff
Seems like adding .default to require call for reducers on webpack HMR fixes it.
if (module.hot) {
module.hot.accept('../reducers', () => {
const nextReducer = require('../reducers').default
store.replaceReducer(nextReducer)
})
}
Note that when using require if you want the default export you need to manually grab it through .default. Reason for this is require doesn’t handle both default and normal exports so you have to specify which to return. Whereas import has a system for this in place so it knows already (eg. import foo from 'bar') vs import {baz} from 'bar').
Taken from webpack-your-bags
I made a PR for this
Hi, I'm changing todos 'add todo' reducer to set completed to true on creation and I get:
Tested on unmodified Todo app, Any ideas?