Yup resolver validation seems to be unlinked with the form
See original GitHub issueDescribe the bug Using resolver, the synchronization between the form and/or the schema validation seems to be unlinked.
To Reproduce https://github.com/react-hook-form/resolvers/issues/28 https://github.com/react-hook-form/resolvers/issues/27
Codesandbox link (Required) https://codesandbox.io/s/polished-framework-ofvx8 https://codesandbox.io/s/magical-almeida-j941j?file=/src/App.js
Expected behavior
All is on the two stories. I repost here because it seems to be link with the react hook form core.
I expect to get the form validation the same as the yup validation.
The first example is a simple form with yup and his when
to target another value in the schema. Only the max errors respond to his own field. If you change the min value less than the max value we expect to have no more error.
We can see the isValid
form trigger properly but the message still there.
For the second example, for me it was the same use case. I inject a different context to the yup context but the form do not reflect the yup validation as expected. All are well explained in those stories. Hope you can track it easily. Thx in advance 😃
Issue Analytics
- State:
- Created 3 years ago
- Comments:27 (14 by maintainers)
@bluebill1049 thanks, first pr for me i will try 😃.
No well it’s perfect @bluebill1049 thank you i did not get the rerender flow ( which follow the normal hook load cycle ) and now it is more clear. No need to go further with a feature request after this explanation ( it could be really great for the docs ). I’m completely agree with your mindset. I would love to have a live session together to help me understand the mindset you made into this library and help you more to contribute for this project. Thanks again for your time.