-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
move initialization to componentDidMount #3615
Conversation
actually, just copying the same functionality form |
Well, actually, quite a few tests are breaking! |
:) @gustavohenke this pr doesn't include the most recent note I wrote. Locally, all the tests are passing. I will update this pr to be that version since all the tests pass |
React 16 ensures a certain order of lifcecycles when replacing a component which causes redux-form to destroy the form, breaking it. This change, when used with `enableReinitialize`, causes the form to reinitialize correctly, preserving the form.
bdfea9f
to
74e31ed
Compare
@gustavohenke updated and the tests just passed locally |
Codecov Report
@@ Coverage Diff @@
## master #3615 +/- ##
======================================
Coverage 100% 100%
======================================
Files 70 70
Lines 1558 1563 +5
======================================
+ Hits 1558 1563 +5
Continue to review full report at Codecov.
|
1 similar comment
Codecov Report
@@ Coverage Diff @@
## master #3615 +/- ##
======================================
Coverage 100% 100%
======================================
Files 70 70
Lines 1558 1563 +5
======================================
+ Hits 1558 1563 +5
Continue to review full report at Codecov.
|
is it likely that this PR will be merged? I have a workaround using setTimeout that I'd rather not implement if I don't have to. |
@stevenmusumeche could you give an example of the workaround? |
In my case, I am navigating AWAY from the form, and when I go back to it, it already has "submitSucceeded" set to true from the previous submission. So, I was able to do a setTimeout and call |
@stevenmusumeche does this solution work for you? |
This PR? I have not run my code with it, sorry. |
Sorry guys. I was sick last week. Meh, I don't care about "perf costs" when hot reloading. Looks good. |
@erikras I was experiencing this in production, not just hot reloading, which is why I brought up the perf cost of this change. |
Yes, same here, it's not just a hot reloading issue. |
@erikras would you be able to do another release that includes this? |
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. |
React 16 ensures a certain order of lifcecycles when replacing a
component which causes redux-form to destroy the form, breaking
it. This change, when used with
enableReinitialize
, causes theform to reinitialize correctly, preserving the form.
this pr address #3435
this is probably going to fail a lot of tests, but want to start the
conversation as to what is needed for redux-form to work with
React 16