Skip to content

Commit

Permalink
feat: reset form on submission
Browse files Browse the repository at this point in the history
  • Loading branch information
keyurparalkar committed Apr 16, 2024
1 parent ad61cf2 commit be058aa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ function App() {
const {
register,
handleSubmit,
reset,
formState: { errors },
} = useForm<TFormValues>();

const onSubmit = (data: TFormValues) => {
console.log("form Data = ", data);
reset();
};

return (
Expand Down

0 comments on commit be058aa

Please sign in to comment.