Closed peeke closed 4 years ago
Great find! Weird I didn't spot it myself.
Question is: how to solve? I think we have a few approaches:
name
would need to become part of the state.I would go for 1. In the rare case that we actually need the name to be correct (which I don't think we will encounter) because we use an old school backend we have a few escape hatches:
name
of the field for array items, but use the index from the array when it's renderedI think we should only consider a complex alternative once we have a use case.
@peeke What do you think?
Based on the above, I'd prefer option 1 as well.
Removing an array item through the helper method returned by
useArrayFormField
can lead to duplicate field names.This happens when:
Both child fields will now have the name
form1.arrayfield[1]