-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
Client-side store memoization not working with hot module reloading #25
Comments
Good catch! Thanks. I will fix it in the next few days. |
I just stumbled over this. Is there any workaround for this that we could apply fast? |
@neogermi as a quick and dirty hack you can fork this library and attach (and restore) the store instance to the |
I suspect that window hack will be the default behavior, I suggest to name the property like The lib itself should not be hot-reloaded, because it does not change so referentially it should always be one object. Anyway, I have pushed a quick fix for you guys, you can install master branch and use it right away. |
Fixed in 1.1.3 |
Great thank you! Currently, 1.1.3 is not available through npm. When do you plan to publish it? |
Oops, something went wrong with NPM publish after Travis CI, I will fix that tomorrow first thing in the morning. |
Published. |
great thank you for the fast response! |
When navigating to a different page in our app we see the following warning:
We believe that this is caused by using both
withRedux
andconnect
. The store is memoized in the module scope here but then HMR reloads the module, which creates another store instance:We initially thought that this might be related to using a
_document.js
template with next.js, especially after seeing this comment, but removing_document.js
didn't solve our issue.The text was updated successfully, but these errors were encountered: