You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I have a nested array with 3 parent elements and I child element, using useFieldArray. If I remove all the default items I get an array with 3 null elements instead of an empty array, using watch. When I try to add a new element, I get 4 parent elements, 3 of them are the elements previously deleted.
Expected behavior
I expect first to have an empty array in the watch when I remove all the elements. And after adding one element on that empty array, I should have only one element in the form and the watch.
Screenshots
Desktop (please complete the following information):
OS: MacOS
Browser: Chrome
Version: latest
Additional context
React Hook Form version: 6.15.7
The text was updated successfully, but these errors were encountered:
Describe the bug
I have a nested array with 3 parent elements and I child element, using useFieldArray. If I remove all the default items I get an array with 3 null elements instead of an empty array, using watch. When I try to add a new element, I get 4 parent elements, 3 of them are the elements previously deleted.
To Reproduce
Steps to reproduce the behavior:
Codesandbox link (Required)
https://codesandbox.io/s/react-hook-form-usefieldarray-forked-iw71g?file=/src/index.js
Expected behavior
I expect first to have an empty array in the watch when I remove all the elements. And after adding one element on that empty array, I should have only one element in the form and the watch.
Screenshots
Desktop (please complete the following information):
Additional context
React Hook Form version: 6.15.7
The text was updated successfully, but these errors were encountered: