From 37e7ddd9e983390e5f8a76a32d93e053e663665c Mon Sep 17 00:00:00 2001 From: Viliam Geffert <60324080+vgeffer@users.noreply.github.com> Date: Sat, 23 Nov 2024 13:30:54 +0100 Subject: [PATCH] Fixed error on registration (#465) * Fixed error on registration * Changed reset params --- src/components/RegisterForm/RegisterForm.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/RegisterForm/RegisterForm.tsx b/src/components/RegisterForm/RegisterForm.tsx index e12f4c35..0c04e537 100644 --- a/src/components/RegisterForm/RegisterForm.tsx +++ b/src/components/RegisterForm/RegisterForm.tsx @@ -45,7 +45,7 @@ const defaultValues: RegisterFormValues = { } export const RegisterForm: FC = () => { - const {handleSubmit, control, watch, setValue, getValues, setError} = useForm({ + const {handleSubmit, control, watch, setValue, getValues, setError, reset} = useForm({ defaultValues, values: defaultValues, }) @@ -96,6 +96,7 @@ export const RegisterForm: FC = () => { }) const onSubmit: SubmitHandler = (data) => { + reset(undefined, {keepValues: true}) submitFormData(data) }