#Validation error type safety when using form composition

5 messages · Page 1 of 1 (latest)

wide stag
#

Is there any way to pass a type down for validation errors when using form composition? Looks like it comes back as any through useFieldContext, but for instance I know I'll always use Zod and so it should always be a ZodError in my case

honest plinth
wide stag
#

I get what you're saying; I'll be sacrificing type safety instead, because I don't want to pass it in for every field

#

I'm just going to use as in my custom components, I just thought maybe one of the generics was it and I just didn't know how to pass it in ha

honest plinth