You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I need to maintain an array of objects in the form. Each object has multiple controls and even nested objects and arrays.
The useFieldArray API does not fit my needs for multiple reasons (I don't really want to go into details as it's quite difficult to explain).
Is it legal and supported to just not use useFieldArray and just use setValue to manipulate the array, even sometimes replacing it as a whole?
I understand it will lead to unnecessary re-renders and that I'll need to keep a list of unique element IDs manually, but I'm willing to do that.
Thanks for answer.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I need to maintain an array of objects in the form. Each object has multiple controls and even nested objects and arrays.
The useFieldArray API does not fit my needs for multiple reasons (I don't really want to go into details as it's quite difficult to explain).
Is it legal and supported to just not use useFieldArray and just use setValue to manipulate the array, even sometimes replacing it as a whole?
I understand it will lead to unnecessary re-renders and that I'll need to keep a list of unique element IDs manually, but I'm willing to do that.
Thanks for answer.
Beta Was this translation helpful? Give feedback.
All reactions