useVieldArray for nested autocomplete field reset's value on every append and remove #11210
Unanswered
AishuSinghG
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hi, we'll need a reproduction codesandbox in order for us to help you |
Beta Was this translation helpful? Give feedback.
1 reply
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Im trying to create a form using react-hook-form which has Autocomplete fields and have nested objects. Here is the object
defaultvalues : {
data:[{
name: string,
testId: string
country:[{
id: string,
value: string
}]
}]
}
For the for Im using 2 useFieldarray
one for data and another for country. So for each data multiple countries can be added. When trying to append country for a data, the all previous values of counter Id is removed (country Id is a Autocomplete field of value type Object)
would need your help on this
Beta Was this translation helpful? Give feedback.
All reactions