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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking change in Formik validate v2 #2167

Open
gwn opened this issue Jan 3, 2020 · 3 comments
Open

Breaking change in Formik validate v2 #2167

gwn opened this issue Jan 3, 2020 · 3 comments
Labels
Focus: Documentation Issues regarding documentation in progress

Comments

@gwn
Copy link
Contributor

gwn commented Jan 3, 2020

馃摉 Documentation

Validate function is not accepting rejected promises of errors, as it did in v1. I was going to report this as a bug, but this looked intentional to me after checking out the code:

} else if (isPromise(maybePromisedErrors)) {
(maybePromisedErrors as Promise<any>).then(
errors => {
resolve(errors || emptyErrors);
},
actualException => {
if (process.env.NODE_ENV !== 'production') {
console.warn(
`Warning: An unhandled error was caught during validation in <Formik validate />`,
actualException
);
}
reject(actualException);
}
);
} else {

So if this is intentional, it needs to be documented among other breaking changes (which atm is not):
https://github.com/jaredpalmer/formik/blob/master/docs/migrating-v2.md#breaking-changes

If not, needs to be fixed.

Related issue from v1: #966

@jaredpalmer
Copy link
Owner

Yeah. Shit, I guess this is breaking after we stopped swallowing the errors in recent releases. can you add to the migration docs?

@gwn
Copy link
Contributor Author

gwn commented Jan 7, 2020

Sure, I will.

@jaredpalmer
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Focus: Documentation Issues regarding documentation in progress
Projects
None yet
Development

No branches or pull requests

2 participants