-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Handle multiple errors returned by Yup #1864
Comments
Is there any progress in regards to this topic? I assume, that Formik still can't process multiple errors for a single field? |
You can do it programmatically. Instead of using
and do something like
|
Expanding on @dieguezz, this will give you a full
So you can:
And, then your Formik errors will be an array of all of the error messages. |
I forgot to share my original mapYupToFormikErrors so it has the same shape than formik errors and you can avoid more customization further on
|
the problem was solved? i need the same thing for my app, i need to show several error messages |
🚀 Feature request
When Yup returns a
ValidationError
aggregating multiple errors I'd like Formik to list all aggregated errors.Current Behavior
Currently if Yup returns ValidationError then its
message
is shown.Desired Behavior
With following validation:
I'd expect Formik to show all aggregated errors.
Suggested Solution
If ValidationError
ve
packs other errors then show all of them, instead of justve.message
Who does this impact? Who is this for?
Ppl using Yup validations (which are recommended by Formik)
Describe alternatives you've considered
Concatenating all errors:
The text was updated successfully, but these errors were encountered: