You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See that isValid is false and isValidating remains true
Fill the lastName input
See that isValid becomes true but isValidating remains true
Expected behaviour
It happens since the v7.51.0, might be introduced by #10657. In the previous version, isValidating became false after the validation process, which seems to make sense.
What seems to be causing this issue here is triggering validation in a useEffect, however, for technical reasons we need to do this in our project:
// in the <Toolbar> componentReact.useEffect(()=>{trigger();},[]);
What browsers are you seeing the problem on?
Firefox, Chrome
Relevant log output
No response
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
adguernier
changed the title
issue: isValidating remains true while triggering form in a useEffect
issue: isValidating remains true by triggering form in a useEffectMar 12, 2024
It is fixed in the latest release when trigger() is used for all fields, but for a specific field ( trigger("fieldName") ) isValidating still returns true.
It is fixed in the latest release when trigger() is used for all fields, but for a specific field ( trigger("fieldName") ) isValidating still returns true.
create an issue with reproducible codesadnbox and steps to reproduce
Version Number
7.51.0
Codesandbox/Expo snack
https://codesandbox.io/p/sandbox/react-hook-form-pending-validating-tgsnvt
Steps to reproduce
firstName
inputisValid
isfalse
andisValidating
remainstrue
lastName
inputisValid
becomestrue
butisValidating
remainstrue
Expected behaviour
It happens since the v7.51.0, might be introduced by #10657. In the previous version,
isValidating
becamefalse
after the validation process, which seems to make sense.What seems to be causing this issue here is triggering validation in a
useEffect
, however, for technical reasons we need to do this in our project:What browsers are you seeing the problem on?
Firefox, Chrome
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: