Why does using useFormContext with formState
in a child component cause the parent(useForm) component re-render when validation fails?
#12944
Unanswered
tony-hsueh
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.
-
Version Number
7.47.0 & 7.60.0
Codesandbox
https://codesandbox.io/p/sandbox/wp53c3?file=%2Fsrc%2FApp.js%3A44%2C7-44%2C21
Case A: Triggers component that calls useForm (App component) re-render
Case B: Does NOT trigger component that calls useForm (App component) re-render
I'm wondering:
formState: { errors }
from useFormContext ?useForm
? (Currently, I replaced useFormContext with useFormState or useController)Beta Was this translation helpful? Give feedback.
All reactions