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

Fix 2.1.4 regression with initialValues updating #2318

Merged

Conversation

jamesmosier
Copy link
Contributor

This PR remove code introduced in #2205 as described in this issue #2292

To reiterate, as of v2.1.4, initialValues cannot be counted on to not change during the duration of a page load. This code which was introduced in v2.1.4, updates initialValues anytime the initialValues passed into <Formik> changes. Therefore if I have an application and the initialValues I pass in happen to change then Formik will update that in its internal state and therefore when doing things like determining if a form is dirty it can report unexpected results.

This by proxy would then force #2034 to be investigated/fixed again.

@vercel
Copy link

vercel bot commented Feb 26, 2020

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/jared/formik-docs/nb1yq2n5j
✅ Preview: https://formik-docs-git-fork-jamesmosier-patch-initial-values-68af84.jared.now.sh

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 0cd15f5:

Sandbox Source
Formik TypeScript Playground Configuration

@sPaCeMoNk3yIam
Copy link

Need this fix, right now (in 2.1.4) resetForm is not working as expected and forces me to stay on 2.1.3.

@jaredpalmer jaredpalmer merged commit 26c4f86 into jaredpalmer:master Mar 9, 2020
@jaredpalmer
Copy link
Owner

@jamesmosier @sPaCeMoNk3yIam agree. good looks and thanks for this

@jamesmosier jamesmosier deleted the patch/initial-values-regression branch March 9, 2020 15:29
@cspicuzza
Copy link

Thanks for tackling this issue. How soon will it be released?

@lnmp4000
Copy link

I've just spent ages debugging this issue with resetForm in my application. I was just about to raise the issue, so glad this is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants