Replies: 1 comment
-
Did you managed to solve this? The problem is that the debounced function always returns the result of the last invocation (or |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've been trying to get a debounced username field work with async validation. So far I've not managed to make it work and I'd appreciate any pointers. Here is a simple example reproducing the issue, the only difference between the two forms being that the async validation callback is debounced (via the
use-debounce/useDebouncedCallback
hook) or not.https://codesandbox.io/p/sandbox/async-debounced-resolver-8lxtmt
My issue here is that the form validation is late in the debounced version: despite the
isValid
boolean being received, this does not get reflected on the form's state until the next validation (onBlur / onChange).Happy to move this to another place (stackoverflow?) if this question does not belong here- the discussions in @hookform/resolvers are closed so I figured I'd ask here.
Beta Was this translation helpful? Give feedback.
All reactions