Describe the bug
When using nested field arrays. Remove is not really removing the field from the fields array. Instead, the field is set to undefined
and fields
array maintains the same length.
To Reproduce
Steps to reproduce the behavior:
- Go to the CodeSandbox provided below
- Click on add child
- Click on add child
- in the console,
fields
will be[Object, Object]
- Click on remove child
- in the console,
fields
will be[Object, undefined]
Codesandbox link (Required)
https://codesandbox.io/s/hook-form-nested-field-array-t4m3g?file=/src/App.js
Expected behavior
The fields should me removed from the array and fields.length
should reflect the actual fields count.
Desktop (please complete the following information):
- OS: macOs
- Browser: Chrome 88
- Version 6.15.4
thanks, @Elia-Darwish we will most like to ship the release candidate (stable version) this weekend, so expect a lot of those “issues” get resolved in V7.