#ZodValidator not working as supposed to

13 messages · Page 1 of 1 (latest)

burnt steeple
#

Shouldn't return value in onSubmit be infered from ZodValidator rather than initialValues?

I have enum in zod schema that is then transformed to string in onSubmit type

wicked patio
burnt steeple
#

Yeah but you can't submit successfully not validated data right?

#

So we can infer that type

wicked patio
burnt steeple
#

Do you plan to change that? Do you think that this approach is good?

#

I love your work and form hook. I love also typesafety and I'd love to see that strict zod integration in some form hook

wicked patio
burnt steeple
#

Oh I see

vale hearth
burnt steeple
#

The solution is to use infered type from zod in useForm generic 😉

#

But I hoped that that can be avoided by inference from validator

#

And I get why this is not an option