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

Added an optional callback formatError to allow custom error message handling #150

Closed
wants to merge 1 commit into from

Conversation

ryall
Copy link

@ryall ryall commented Jun 29, 2020

Fixes #144

@ryall ryall marked this pull request as ready for review June 29, 2020 12:52
@jannikbuschke
Copy link
Owner

jannikbuschke commented Jul 4, 2020

Hi @ryall ,

Thanks for your willingness to contribute.

Im not so sure about this change, as the FormItem itself is already a quite complex component. There are several issues with it, in general in my opinion is: "it does to many things". With your proposed change it would even do more, so I am very hesistant to actually accept this PR.

You might want to think about alternatives. I.e. can't you change the error messages before giving them to formik?

I am totally open for discussion, however the FormItem component already is a bit messy. The complexity comes also from Ant design itself. The FormItem is responsible for layout stuff, labeling and rendering validation indicators (red borders around inputs) and errormessages....

@ryall ryall closed this Jul 6, 2020
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.

Run a function over errors in Form.Item / validationSchema? (Yup, i18next)
2 participants