Replies: 7 comments 1 reply
-
hi there, the here is a codesandbox with the above PR: https://codesandbox.io/s/cocky-franklin-sn0vn?file=/src/App.js:1373-1383 |
Beta Was this translation helpful? Give feedback.
-
I think the suggestion even wrong, lines (13-17): const { control } = useFormContext()
const { fields } = useFieldArray({
control, // control props comes from useForm (optional: if you are using FormContext)
name: "data" // unique name for your Field Array
}); should be replaced with: const { watch } = useFormContext()
const fields = watch('data') |
Beta Was this translation helpful? Give feedback.
-
If the OP just wants to The OG CSB includes |
Beta Was this translation helpful? Give feedback.
-
yes, the watch works for value render, I think if the user does want to sync field array. the FormContext with field array is a good utility to be included which is currently in PR. |
Beta Was this translation helpful? Give feedback.
-
I'll give the feature another thought, 'cuz I don't exactly like how it clutters the component body, but we might wanna just move ahead with it |
Beta Was this translation helpful? Give feedback.
-
Maybe move the issue to discussion? |
Beta Was this translation helpful? Give feedback.
-
yea move to discussion. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Version Number
7.18.0
Codesandbox/Expo snack
https://codesandbox.io/s/react-hook-form-v7-bug-06vmyz
Steps to reproduce
Expected behaviour
useFieldArray fields synchronize changes
What browsers are you seeing the problem on?
No response
Relevant log output
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions