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: if 'isValid' value is used, mode and revalidationMode behaves like 'onChange' #944

Open
1 task done
Bytekunst opened this issue Apr 17, 2023 · 6 comments
Open
1 task done
Labels
question Further information is requested

Comments

@Bytekunst
Copy link

Version Number

7.43.9

Codesandbox/Expo snack

https://codesandbox.io/s/react-hook-form-basic-forked-5gi2ng

Steps to reproduce

Based on the closed issue here react-hook-form/react-hook-form#10215 i try to "reopen" this bug.
It makes no sense, that this behaviour of 'isValid' has changed and that the issue was closed with the answer (react-hook-form/react-hook-form#10215 (comment))

Expected behaviour

isValid should not change useForm modes to onChange

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
@bluebill1049
Copy link
Member

Expected behavior, what's your use case? Why is this an issue?

@bluebill1049 bluebill1049 added the question Further information is requested label Apr 17, 2023
@Bytekunst
Copy link
Author

Expected behavior, what's your use case? Why is this an issue?

For example we have 2 async validation calls. So on every onChange they are fired.
I know i could use debouncing here but is this the best practice in my case?
So if we use the 'isValid' prop, we are stuck with validation onChange atm and as the tomchen said in the linked issue above, this wasnt always the case and changed with v7.39.
Such a change should really be documentend.

@bluebill1049
Copy link
Member

Please refer to the release log, it's 100% there. This is more of a DX improvement, so the user won't have to change to the specific mode in order to subscribe to invalid and it certainly works for some user who doesn't want to set it to onChange and still wants to subscribe to invalid. So this won't get revert back.

@Bytekunst
Copy link
Author

Please refer to the release log, it's 100% there. This is more of a DX improvement, so the user won't have to change to the specific mode in order to subscribe to invalid and it certainly works for some user who doesn't want to set it to onChange and still wants to subscribe to invalid. So this won't get revert back.

Yeah i see it in the release logs. I mean the behaviour change should be documented in the docs (https://react-hook-form.com/) with 'isValid'.

Thanks for your answer. We will try to live with it and find a solution for our problem :)

@bluebill1049
Copy link
Member

Yeah i see it in the release logs. I mean the behaviour change should be documented in the docs (https://react-hook-form.com/) with 'isValid'.

Sure, I can include a note in the doc after work today.

@bluebill1049 bluebill1049 transferred this issue from react-hook-form/react-hook-form Apr 18, 2023
@bluebill1049
Copy link
Member

I will update the doc once we migrated to 18 to reduce conflicts before the merge: #940

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants