Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hot reloading reducers is now explicit - example broken? #843

Closed
pldilley opened this issue Dec 20, 2017 · 2 comments
Closed

Hot reloading reducers is now explicit - example broken? #843

pldilley opened this issue Dec 20, 2017 · 2 comments

Comments

@pldilley
Copy link

pldilley commented Dec 20, 2017

The example on hot loading reducers is given here: https://github.com/reactjs/react-redux/releases/tag/v2.0.0

if (module.hot) {
// Enable Webpack hot module replacement for reducers
module.hot.accept('../reducers', () => {
const nextRootReducer = require('../reducers/index');
store.replaceReducer(nextRootReducer);
});
}

For me, it didn't work until I changed the following:
module.hot.accept('../reducers', () => { TO module.hot.accept('../reducers/index', () => {

Is the example on that page incorrect or am I missing something?

@timdorr
Copy link
Member

timdorr commented Dec 20, 2017

Those are very old release notes. You should consult your build tool's docs for now to do this.

@timdorr timdorr closed this as completed Dec 20, 2017
@pldilley
Copy link
Author

pldilley commented Dec 20, 2017

P.S. For anyone else looking for a recent solution, this seems more on track: #502

Edit: Together with this too: https://github.com/gaearon/react-hot-loader/blob/master/docs/Troubleshooting.md#react-hot-loader-this-component-is-not-accepted-by-hot-loader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants