-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Custom error messages can't be modified with ErrorMap #2492
Comments
I have opened an issue in react-hook-form repo. I realized that it was a mistake and it is an problem with zod and not react-hook-form. I have exactly the same problem I would love to be able to override every possible error message with ErrorMap but it is not working. Any updates on the issue? |
I think the current priority order makes more sense. It would be very odd if the error map couldn't be overridden by a special case defined at the level of an individual schema. |
Ok, that makes sense. |
According to the documentation it should be possible to override all error messages, but it only works with custom errors only if the original message is undefined. Messages defined in refinements seem to be hardcoded and values returned by ErrorMap are ignored.
codesandbox example
The text was updated successfully, but these errors were encountered: