-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
react-redux 5.0.3 breaks hot-reloading #636
Comments
Can you define "broken"? What is wrong? What errors are you seeing? |
with
with
It looks like after a hot-reload the components and the redux state are not properly connected anymore. You can easily reproduce that by updating to works fine with |
Strange, since HMR was known to be broken in 5.0.2 and supposedly fixed in 5.0.3, but you're experiencing the opposite. |
I think I have a similar problem with 5.0.3. The problem resolved when going back to 5.0.2. Unfortunately, I don't have a minimal example, but I did notice that if the Redux state changed, this piece of code is only executed for the Using the React developer tool (in Chrome), when I click a connected component that is not updating, running I'll try to summarize this:
|
I'm having the same problem as described in one of the above comments: #636 (comment) My yarn.lock is telling me I'm on react-redux 5.0.2 however, not 5.0.3. EDIT: I tried 5.0.1 and it has the same issue. EDIT EDIT: and 5.0.3. |
I'm also able to perform the steps listed by @basilfx above to show how the ancestor connectAdvanced component's call to onStateChange() does not trigger an update to to the child component which should be updated. |
Damn, just having the same issue. Unfortunately with both 5.0.2 and 5.0.3. Performing the steps suggested by @basilfx forces the update and the page renders correctly. |
Hmm. I've got a lot on my plate atm, but I will try to dig into this at some point in the near future. As an alternative, you may want to consider using the "plain" HMR API, rather than |
I'm also having the same problem, with both 5.0.2 and 5.0.3. Edit: Going back to 4.4.6 fixed this for me. |
me too! how to solve it |
Experiencing what I believe to be the same issue, with Put together a couple repro case based on Originally opened this issue in the Reproducible Demo
Then:
There is a note in |
Just got this fixed for me by downgrading react-redux from v5.0.3 to v5.0.2. |
We already knew downgrading to 5.0.2 fixed the problem (and some having to go back to 4.x). Why would that close this issue? The bug is that we still can't use 5.0.3 (and up to current 5.0.5). |
@markerikson my apologizes, the link in the email took me to the above comment, which I had missed the PR #. Thank you and sorry again. |
Can confirm this partially fixes my repro case. I now have a different issue with the included redux-form component, however that may be isolated to redux-form. After a hot reload, form fields are now updating properly, but the form state is lost. |
@rogersp that same behavior on redux-form exists in react-redux 4.4.x as well. I believe it's due to the "attach/detach" actions that redux-form performs when a component is reloaded. |
Agreed. Appears to be an issue with react-redux. Most recent issue and workaround here: redux-form/redux-form#3005 Thanks for the fix! |
This seem to have been fixed with release |
|
I had to update to |
Description
After updating from
react-redux
5.0.2
to5.0.3
hot reloading breaks the redux state.Expected behavior
hot reloading should not break the redux state.
Actual behavior
with
react-redux
5.0.3
the redux state breaks after a hot reload has happened.Environment
react-hot-loader
3.0.0-beta.6
Reproducible Demo
Any project with
react-hot-loader
will do, just upgradereact-redux
to5.0.3
and experience the issue.The text was updated successfully, but these errors were encountered: