Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue: 'isValidating' state is not updated after triggering validation #9582

Closed
1 task done
sergeyivanovv89 opened this issue Dec 13, 2022 · 2 comments
Closed
1 task done
Labels
duplicated duplicated issue

Comments

@sergeyivanovv89
Copy link

Version Number

7.40.0

Codesandbox/Expo snack

https://codesandbox.io/s/rhf-bug-with-isvalidating-state-bhym4v

Steps to reproduce

  1. Click on 'Validate'
  2. See error

Expected behaviour

'Validate' button should not be disabled because validation just has been triggered.

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Moshyfawn
Copy link
Member

As a quick workaround, you can get the formState from useFormContext instead of useFormState like

-  const { trigger } = useFormContext()
+  const { trigger, formState } = useFormContext()
-  const { isValidating } = useFormState()
+  const { isValidating } = formState

@bluebill1049 bluebill1049 added the duplicated duplicated issue label Dec 13, 2022
@bluebill1049
Copy link
Member

Thanks @Moshyfawn

@ivanovserge This is fixed and will be released this week. #9521

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicated duplicated issue
Projects
None yet
Development

No branches or pull requests

3 participants