Skip to content
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

INITIALIZE action is called twice when initialValues is presented #3690

Closed
martinhorsky opened this issue Dec 13, 2017 · 6 comments · Fixed by #3797
Closed

INITIALIZE action is called twice when initialValues is presented #3690

martinhorsky opened this issue Dec 13, 2017 · 6 comments · Fixed by #3797

Comments

@martinhorsky
Copy link
Contributor

Are you submitting a bug report or a feature request?

Bug introduced by #3615

What is the current behavior?

INITIALIZE action is called twice when initialValues prop is used. This behaviour can cause problems with reinitializing props for the second time after values could be already changed (in componentWillMount of children of the form).

What is the expected behavior?

Call INITIALIZE once.

Do not call for the second time in componentDidMount or handle properly initialized in this.initIfNeeded, which is false after the first initialization in componentWillMount.

What's your environment?

Redux Form 7.2.0

Other information

Bug was introduced in https://github.com/erikras/redux-form/releases/tag/v7.2.0 in bug fix called "Fixed hot reloading problem with React 16" #3615

@jason-whitted
Copy link

Here are some working examples illustrating the issue:

@mikecit22
Copy link

Hi, I am having the same issue. The redux form called @@redux-form/INITIALIZE 2 times.

@aarosil
Copy link

aarosil commented Jan 23, 2018

I could confirm this introduced in 7.2, not happening in 7.1.2.

Thanks for the killer library!!!

@erikras
Copy link
Member

erikras commented Feb 1, 2018

Published fix in v7.2.2.

@mccasey
Copy link

mccasey commented Jul 10, 2018

I'm still having the same issue with v7.2.2.

@lock
Copy link

lock bot commented Jul 10, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants