Thanks for sharing that @Pradip_Kumar_Parkar!
It looks like, right now, all of the nested listviews are referencing the same value:
You'll instead want to set state1
to be somehow indexable, for instance by initiating it as an array so that you can use the index of the listview with something like state1.value[i]
:
When you set the value of the state you'll then want to use setIn
instead of setValue
:
And then when you add a new subform you'd want to add or remove an entry to the array as well:
With all of that set up, you don't actually need a separate state for the parent listview's length! You can just reference the length of the array:
Does that work?