How to use useFieldArray with nested components and avoid re-render after deleting element from array #11194
Unanswered
KalachevDev
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I have a case when I have something like this
I have really large form and I need to avoid any unnecessary re-renders. Here, for example, if I remove any non-last element, all components will re-render due to
handleRemove
callback changeI can do something like this:
In this case all elements that are following removed element will re-render due to
indexToRemove
property change.Probably something like this will solve the issue, but I'm not sure if it's a good solution:
Beta Was this translation helpful? Give feedback.
All reactions