react-hook-form types

I'm using react-hook-form with typescript and I changed from using the useForm to the useFormContext and Typescript brought to my attention that the types of the errors are not the same. Using useForm, errors.firstName.message is of type string as I would expect, but with the context version, the type is string | FieldError | Merge<FieldError, FieldErrorsImpl<any>> | undefined. Why are these types different and how do I just get the message while using the context version?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server