Describe the bug
When using nested field array, remove has stopped working properly on version 6.15.2 and 6.15.3.
Calling remove on the parent field array is not behaving as expected. Instead, the fields are somehow being replaced with empty fields while maintaining the same array length. Also, the field id
undefined for the new fields.
I created a minimal CodeSandbox to demonstrate the bug:
Steps to reproduce the behavior:
- Go to the CodeSandbox provided below.
- Click on add child.
- Click on remove child.
- The child is not removed and react will show a warning saying
Warning: Each child in a list should have a unique "key" prop.
- downgrade to version 6.15.1
- add children and nested children and remove them.
- notice how no errors are shown and that remove is behaving as expected!
Codesandbox link (Required)
Remove should behave like it did before on earlier versions.
Desktop (please complete the following information):
- OS: macOS
- Chrome 88
I might be wrong, but I think this is related to #4172