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

Abort submit if instance of real Error #2104

Merged
merged 4 commits into from
Dec 11, 2019
Merged

Conversation

jaredpalmer
Copy link
Owner

@jaredpalmer jaredpalmer commented Dec 10, 2019

Because of the new behavior in 2.0.7, we actually need to change our validity check in submitForm to deal with what happens if there is an error thrown in validate somehow. 2.0.7 exacerbated this bug by logging it to the console. With this change, Formik will only throw the error if it is an instance of error

Fix #1198

@vercel
Copy link

vercel bot commented Dec 10, 2019

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/62w6eq3h7
🌍 Preview: https://formik-docs-git-fix-isvalid-error-instance.jared.now.sh

@jaredpalmer jaredpalmer changed the title Fix #1198. Change isValid to check if instance of real error, abort submit and throw Fix #1198. Change isValid to check if instance of real Error, abort submit and throw Dec 10, 2019
@jaredpalmer jaredpalmer changed the title Fix #1198. Change isValid to check if instance of real Error, abort submit and throw Change isValid to check if instance of real Error, abort submit and throw Dec 10, 2019
@jaredpalmer jaredpalmer changed the title Change isValid to check if instance of real Error, abort submit and throw Abort submit if instance of real Error Dec 10, 2019
@codesandbox-ci
Copy link

codesandbox-ci bot commented Dec 10, 2019

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 bda4231:

Sandbox Source
Formik TypeScript Playground Configuration
Formik validate error handling Issue #1198

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.

Form is submitted if there are uncaught errors in validate function
1 participant