issue: ZodResolver doesn't update form error state with multiple fields involved #10745
-
Version Number^7.43.9 Codesandbox/Expo snackhttps://stackblitz.com/edit/stackblitz-starters-rnayem?file=src%2FExampleForm.tsx Steps to reproduce
Expected behaviourI would like the error state to update correctly within the (TextInput component) when the form state elsewhere has caused the form to become valid. I am not entirely sure which library is at fault here but it feels like React Hook Form isn't updating the error state correctly when an outside component is the one that triggers the new state. What browsers are you seeing the problem on?Chrome, Edge Relevant log outputNo response Code of Conduct
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
React hook form focus on field level validation, if you need dependent update use trigger api. |
Beta Was this translation helpful? Give feedback.
-
For reference: @bluebill1049 Thanks I'll take a look and potentially post an update to this issue. |
Beta Was this translation helpful? Give feedback.
Updated example using trigger, which I think solves my problem:
https://stackblitz.com/edit/stackblitz-starters-lrau1a?file=src%2FExampleForm.tsx