-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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: isValid changes from false to true on first render when react strictMode enabled #9765
Comments
The same on latest version (7.41.5) |
|
You can remove React.StrictMode component and isValid stays false |
@Moshyfawn is isValid changing from |
My bad, I read the |
@bluebill1049 it seems like whatever is causing it is fixed in You can checkout this codespace: navigate to Basic |
thanks a lot @Moshyfawn I will release the minor update today. |
It seems the root cause is from line 97 in react-hook-form/src/useController.ts Lines 76 to 99 in 4b4f1d8
With react-hook-form/src/logic/validateField.ts Lines 54 to 55 in 4b4f1d8
|
yes @leapful you are right. I get deep-fried by this |
thanks, @leapful for your help! Finally, figure out a solution for this. |
@bluebill1049 Thanks! |
Version Number
7.40.0
Codesandbox/Expo snack
https://codesandbox.io/s/react-hook-form-v7-controller-ts-forked-8ikori?file=/src/index.tsx
Steps to reproduce
false
totrue
Expected behaviour
isValid is false, because input is required
What browsers are you seeing the problem on?
Chrome
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: