This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
issue: AJV resolvers custom keywords errors are not present in formState.errors #11890
Closed
1 task done
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
The text was updated successfully, but these errors were encountered: