We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Hello, I have an issue to reset a field on my react typescript project, I'm using zod and hook form.
To Reproduce First I do my object:
const interventionSchema = z.object({ thematiqueId: z.number().optional().nullable(), domaineId: z.number().optional().nullable(), });
Next I do my useForm:
const { register, handleSubmit, reset, setValue, watch, resetField, } = useForm<InterventionPost>({ resolver: zodResolver(interventionSchema), defaultValues: { domaineId: undefined, }, });
In my form I have on a Select:
onValueChange={(value) => { setValue("thematiqueId", Number(value)); reset({ domaineId: undefined, }); resetField("domaineId"); }}
Expected behavior On the logs, the value of domainId is not on undefined:
useEffect(() => { console.log("Form Values:", watch()); }, [watch()]);
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
Hello, I have an issue to reset a field on my react typescript project, I'm using zod and hook form.
To Reproduce
First I do my object:
Next I do my useForm:
In my form I have on a Select:
Expected behavior
On the logs, the value of domainId is not on undefined:
The text was updated successfully, but these errors were encountered: