What's the best way to access a field array when 'append' has been called from a different component? #10894
Unanswered
kainbryanjones
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.
-
So my understand is the useFieldArray hook's 'fields' value is not shared accross instances of the hook call (i.e. if I call 'append' in one component it won't automatically update a 'fields' value from another component which is calling useFieldArray on the same field.). However the getValues() return value does update no matter where append is called from.
My question is what's the best way to access the newly updated fields? Say I have a reusable Button to update a field array then my 'fields' value is only going to be the latest inside this button.
I have no issue using the getValues from useFormContext but my issue is I want to have the 'id' field from each field inside the 'fields' value, which is not present in the getValues return value.
Beta Was this translation helpful? Give feedback.
All reactions