react-hook-form: issue: isValid not consistent with errors while validation
Version Number
7.39.6
Codesandbox/Expo snack
https://codesandbox.io/s/empty-morning-j0yr37?file=/src/App.tsx
Steps to reproduce
- input ‘aaaa’, you can see there is an error message but the button is still enabled due to
isValidis true
Expected behaviour
- If there is an error message, the button should be disabled
What browsers are you seeing the problem on?
Chrome
Relevant log output
No response
Code of Conduct
- I agree to follow this project’s Code of Conduct
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 4
- Comments: 22 (13 by maintainers)
Commits related to this issue
- Merge branch 'master' into fix-#9454 — committed to react-hook-form/react-hook-form by bluebill1049 2 years ago
@bluebill1049 This works for me, thanks for you work!
@blingblingredstar let me know if you want to verify the fix before I close this issue with PR.
This is a regression introduced in the last patch, i am looking for a better solution before roll it back.
sorry about the context api regression…
This issue won’t give an immediate fix, as promise-based race conditions will need to be planned and considered carefully.
Something changed in
7.39.6the errors get fromformState.errorsalways is empty