From be058aaefcd8d1b7019d281885783bb0af770e0f Mon Sep 17 00:00:00 2001 From: keyurparalkar Date: Tue, 16 Apr 2024 10:56:10 +0530 Subject: [PATCH] feat: reset form on submission --- src/App.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/App.tsx b/src/App.tsx index 97ecadc..ca05ade 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -45,11 +45,13 @@ function App() { const { register, handleSubmit, + reset, formState: { errors }, } = useForm(); const onSubmit = (data: TFormValues) => { console.log("form Data = ", data); + reset(); }; return (