How to reset form after submit in React Hook Form? #12991
-
After submitting the form, I want to reset the input fields to their default values. What’s the correct way to do this in React Hook Form? |
Beta Was this translation helpful? Give feedback.
Answered by
AmanRai8
Jul 28, 2025
Replies: 1 comment
-
You can use the reset() function from React Hook Form to reset the form after submission. Example:
If you want to reset with new values, you can do: |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
PriyankaChaudhary0075
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use the reset() function from React Hook Form to reset the form after submission.
Example:
If you want to reset with new values, you can do:
reset({ name: "John", email: "" });