Not using index as key while looping values lead to `field.state.value is undefined` when deleting
Here is my minimal example of one of my complex forms in a project:
Here, when I delete any items except the last one using the delete button of
If I change the key of
If you are wondering why I am separating
Here, when I delete any items except the last one using the delete button of
Child component, then it causes leads to field.state.value is undefined error.If I change the key of
li in Child component to index, then it works fine. I don't want to use index as keys for obvious reasons. Is there any way to fix this issue? Is there any other ways to do the same thing?If you are wondering why I am separating
GrandChild component, then let's just say that my form is much complicated than this example. That's why I must separate the component.