issue: AJV resolvers custom keywords errors are not present in formState.errors #11899
Unanswered
javier-brenes-zen
asked this question in
Q&A
Replies: 1 comment
-
Pretty sure this is a lack of input registration, have you tired to register those missing error field? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Version Number
7.51.0
Codesandbox/Expo snack
https://stackblitz.com/edit/stackblitz-starters-vtxdst?file=src%2FApp.js,src%2FcustomKeywords.js
Steps to reproduce
cannotBeEqualTo
definition and verify we are passing error.CR
for state, and123
for PlatecannotBeEqualTo
validationserrors
in console, I am expecting to see the errorcannotBeEqualTo
custom keyword produces but it is not there so I cannot give feedback to user.Expected behaviour
I am expecting getting the error in
formState.errors
so I can use it to give feedback to the user, I already tested the Json schema using ajv directly and I am seeing the error being returned so it has to be something in React-hook-form that deletes the error or doesn't include it on theformState.errors
.AJV validation codesandbox: https://shhttps://shorturl.at/fgJQ3orturl.at/fgJQ3
Evidence:
I added some console.log at https://github.com/react-hook-form/resolvers/blob/master/ajv/src/ajv.ts locally so I guarantee error is being captured
and just after that this is what I get from react-hook-form on my app.
as you can see form is
invalid
but no errors come.What browsers are you seeing the problem on?
Chrome
Relevant log output
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions