Replies: 1 comment
-
const schema = z
.object({
password: z.string().min(6).max(100),
confirmPassword: z.string().min(6).max(100),
})
.refine(({ password, confirmPassword }) => password === confirmPassword, {
message: "Passwords do not match.",
path: ["confirmPassword"],
});
const form = useForm({
resolver: zodResolver(schema),
/* ...other useForm props */
});
<Controller
control={form.control}
name="password"
rules={{ deps: ["confirmPassword"] }}
/* ...other Controller props */
/>; Is this the intended use of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Can someone please clarify the usage of
deps
in therules
of<Controller />
? I couldn't find detailed information about it in the documentation.Specifically, can
deps
be used to trigger dependent validation when using an external library for validation?Beta Was this translation helpful? Give feedback.
All reactions