New issue
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
Form reset, append adds ghost empty fields #11836
Comments
I faced a bug that looks similar to the described here. I've tried different versions of react-hook-form and found that the bug was introduced in version |
@Rudomitori Just tested versions till |
clean up your codesandbox. |
It took some time but I finally managed to reproduce my use case. Steps:
|
@imprakharshukla You can fix this issue by passing const onReset = () => {
reset({}, { keepDefaultValues: true });
}; |
Version Number
7.51.3
Codesandbox/Expo snack
https://codesandbox.io/p/sandbox/react-hook-forms-appenderror-97c7km?file=%2Fsrc%2FApp.tsx%3A813%2C28
Steps to reproduce
The first click logs an empty error object and then the next click suddenly adds about 12 fields in the inventory key.
Expected behaviour
The extra 12 ghost empty inventory fields should not be added.
What browsers are you seeing the problem on?
Firefox, Chrome, Safari, Edge
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: