issue: useFieldArray and getFieldState causes react console warnings #11901
Replies: 5 comments
-
Might be related to the issue described in https://github.com/orgs/react-hook-form/discussions/10964#discussioncomment-9113909. |
Beta Was this translation helpful? Give feedback.
-
Investigated this a bit more, and noticed that the issue seems to be related to passing the whole So in the example it would look like this function Validation() {
const {
getFieldState,
formState: { errors },
} = useFormContext();
const { invalid } = getFieldState("cats");
return invalid === true ? "BAD CATS" : "GOOD CATS";
} |
Beta Was this translation helpful? Give feedback.
-
I still have this problem in 7.51.3 |
Beta Was this translation helpful? Give feedback.
-
@sim391calado That was actually the version I used as well, not sure why the issue template generated an old version. Fixed that now. Did removing |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Version Number
7.51.3
Codesandbox/Expo snack
https://codesandbox.io/p/sandbox/nervous-pateu-v5t8t2
Steps to reproduce
Also, the render count increases a lot more than expected.
Expected behaviour
While the form works from the user perspective, I would expect it do so without producing React warnings.
What browsers are you seeing the problem on?
Chrome, Safari
Relevant log output
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions