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 reload causing destroy #623
Comments
Oooh, interesting. I am seeing this as well. It didn't used to do this. But it does not look like a @gaearon, is calling |
There is no new behavior, the repo has not been updated in months :-) |
How I did it:
It will hot reload and It's not the most minimal example, but it's pretty simple to get running locally to replicate this issue. |
I'm having this issue with generic HMR as well. If you're using HMR at the render point, as advocated in @gaearon's recent post, here's the workaround: const store = configureStore();
const mountPoint = document.querySelector('[data-root]');
render(<Root store={store} />, mountPoint);
if (module.hot) {
let persistentStore = store;
module.hot.accept('src/Root', () => {
const NextRoot = require('src/Root').default;
persistentStore = configureStore(persistentStore.getState());
render(<NextRoot store={persistentStore} />, mountPoint);
});
} |
In fact there's an even simpler solution. Just set |
Trying to reproduce this. Running
Running it in the root doesn’t work either:
|
@gaearon Sorry that directory structure has changed in the interim. I've fixed it. Try again, in the |
Any updates on this? Does it make sense to have |
Hey guys, any news on this issue? Is |
Is there a reason the commit that fixed this issue no longer exists in v6.3.2? 0b8dd94#diff-d749bb1257f721af37259e0346e623be I'm currently using the destroyOnUnmount fix but there is no way to specify this globally (as far as I am aware of) so it seems hacky to add this option to every wrapped form. |
Hi, any news why 0b8dd94#diff-d749bb1257f721af37259e0346e623be was reverted and is gone from master? |
I think this is what has been screwing me up. I'm using redux-form in a next.js project and have been tearing my hair out while my state disappears automagically with a hot reload... is this going to be put back in? Per this thread it was removed: #947 |
Fix published in |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I'm using webpack-dev-server and I have hot reload working, but my form data gets destroyed because componentWillUnmount is called. From what I can gather from the hot loader demo unmount shouldn't be called. Is this expected, or have I hooked things up wrong?
Here is the callstack:
The text was updated successfully, but these errors were encountered: