Replies: 1 comment 7 replies
-
@brmenchl can you share some code please ? |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I had a use case where a single field in a form needed to change the validation schema of the entire form (determining whether the model was "Published" or not. Published models had more strict validation).
I ended up creating a custom zod resolver that reused almost everything from the existing zodResolver, but allowed you to pass in a function
(values: FieldValues) => z.ZodSchema<any, any>
that you can use to swap out zod schemas at run time.I could add this as a new zod resolver, but I wanted to hear what people think about it.
Beta Was this translation helpful? Give feedback.
All reactions