I am searching for help regarding a problem with react-hook-form / useFieldArray.
I have an Array like this:
[
{name: "one", data: "long string"},
{name: "two", data: "another long string"},
]
This Array is within a form and rendered with the help of useFieldArray.
Now I want to set a new data on the first element. The documentation of react-hook-form gives the function "update":
As I dont want to trigger a remount I am using the setValue API like this:
form.setValue("array.0.data", newValue);
When I do so, I get the new value by using the functions form.watch and form.getValues, but when I query the fields value by using array.fields[0].data I still get the old value.
I would appreciate any help on how to update a single value in an array and get the new value as well in the field as in the form without getting a remount.
Best Regards, Tobias
