You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Redux and when I make changes to the actions (action creators file) I can see that the modules are being reloaded but when I invoke the actions the old actions are still being called. I'm having a bit of an issue trying to zero in on the root cause but I'm working on it.
I'm leaving this here for now, this might not be the best place for the issue but I'm quite certain that the issue is not with Redux but something about the constructor not being rerun on update? or, that the closure is capturing the old action reference and won't see the new action references for that reason.
I've tried both with and without mapDispatchToProps same result.
Here's a snippet of the class structure, for reference
This is because Babel plugin doesn’t wrap module exports automatically and can’t currently detect connect() returns a React component. This issue is described in gaearon/babel-plugin-react-transform#26.
You can use React Hot Loader which doesn’t have this problem.
Alternative, since you use Redux, you can just drop React Transform completely and use vanilla HMR API. In this case, hot reloading action creators will work fine, but React local component state and DOM won’t be preserved (which admittedly is not a terrible issue for Redux apps anyway). See an example of this approach in reduxjs/redux#1455.
This is fixed in React Hot Loader 3.
It is built with lessons learned from both React Hot Loader and React Transform.
It’s still in alpha but I encourage you to check it out!
I'm using Redux and when I make changes to the actions (action creators file) I can see that the modules are being reloaded but when I invoke the actions the old actions are still being called. I'm having a bit of an issue trying to zero in on the root cause but I'm working on it.
I'm leaving this here for now, this might not be the best place for the issue but I'm quite certain that the issue is not with Redux but something about the constructor not being rerun on update? or, that the closure is capturing the old action reference and won't see the new action references for that reason.
I've tried both with and without
mapDispatchToProps
same result.Here's a snippet of the class structure, for reference
The text was updated successfully, but these errors were encountered: