-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FormArrary Delete not working at index level removeAt(index) are we have any solutions to delete by index #42
Comments
You can check the working example of |
@bietkul actually that example shows exactly the problem I'm having. |
I've checked this as I'm considering usage of this library and this is something I'd run into very soon. The underlying values are correct, the See the part where controls are iterated - the key prop for each element is the index. This means that since indexes don't change when mutating the controls array, the fields don't re-render either. Changing the key to something like I'll try to come up with something smarter as soon as I have a similar scenario in my app. |
Hi |
Hey @mojtaba-ramezani |
The above example will work for single remove. My case i want to remove multiple FormControls from FormGroup then need to push new multiple FormControls in the same FormGroup. At that time removeAt will not worked. If i loop through my FormGroup & try to use removeAt it will execute only one time then break the loop, also i have other logic codes below that also not executable. I tried like below code,
|
removeAt is getting issues with using React Hook, also if I tried to generate a from using Json structure, component not getting rerender. Thanks in Advance @bietkul |
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: