-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Reducer is called with previously performed actions when asynchronously loading another reducer #205
Comments
Yes, it's as expected and the same problem is with vanilla Redux DevTools. We don't support Not sure whether we want to solve this on Redux part (adding a second argument for |
A simple solution would be to introduce |
Where I can read about using Cycle mode? |
Ok thank you! |
Is there any way to go around this issue? Disabling devtools is an option but would prefer to have them. |
I have just published const composeEnhancers =
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({
shouldHotReload: false
}) : compose;
const enhancer = composeEnhancers(
applyMiddleware(...middleware),
// other store enhancers if any
);
const store = createStore(reducer, enhancer); See the release notes for more details. Feel free to reopen the issue if it doesn't help. |
Seeing a weird bug only when I use the extension (2.5.1.9). Not using it with Vanilla DevTools. Have followed instructions in the README to set it up.
The bug is: my reducer is called with previous actions when asynchronously loading another reducer.
Say I perform actions say ACTION_X and ACTION_Y in a page. I leave the page and go to another where the new page's reducer is injected. When this happens the previous page's reducer is called with all the actions I performed in that page (ACTION_X & ACTION_Y).
I can confirm the actions are not dispatched from my code after I leave the page and also they do not show up in the extension. I think it's caused because of the reducer injection. Because if I navigate to a page which does not have a reducer this won't happen.
What's weird about this is it happens only for two of the 5 actions I have in the page. Have not observed it in other pages.
Any help to debug this further is much appreciated.
My app uses React Router with Webpack code splitting and I'm asynchronously injecting reducers on a route load like this:
where injectReducer is:
and my
createReducer
looks like thisThe text was updated successfully, but these errors were encountered: