issue: useFormState does not isolate at custom hook level. #10919
Replies: 6 comments
-
This is the current API design choice for how we handle errors: take a look at #10065 for more info. TL;DR Now, in your example, you subscribe to the |
Beta Was this translation helpful? Give feedback.
-
Is there any other best practise to do rather than subscribing to the
but render count shows it's not . Am I missing something? |
Beta Was this translation helpful? Give feedback.
-
@Moshyfawn, Thanks your replies, please give you comments. If |
Beta Was this translation helpful? Give feedback.
-
@Moshyfawn Thank you, I took time to understand what you said from this the last example of the documentation page : https://react-hook-form.com/docs/useformstate |
Beta Was this translation helpful? Give feedback.
-
Could you tell me the significants of |
Beta Was this translation helpful? Give feedback.
-
@bluebill1049 @Moshyfawn
Does that mean, that it will loose subscription once re-rendering of root component happens. please clarify. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Version Number
7.45.4
Codesandbox/Expo snack
https://codesandbox.io/p/sandbox/old-wood-jdhn5w
Steps to reproduce
I'm constructing a form for following type.
NameType
in/types/index.ts
.components/NameForm
.NameForm
within main form with<FormProvider>
.errors
from usinguseFormState
Expected behaviour
useFormState
does not isolate theformState
orerrors
of given field. In fact it having main form errors also ie. errors fromuserName
field.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