Replies: 1 comment 3 replies
-
@cyky : The problem might be related to your API from server-side, not from react-hook-form. According to your stackblitz sample, there is no error handling when calling API inside your custom resolver, therefore in case rate limiting or network issue or any unexpected error from server-side, the custom validation will be crashed and cause flag validating always be true. You should consider to put a try catch statement and add logging on error that can be synced to monitoring service like datadog, elastic stack to check if the problem is coming from server-side or not. P.S: You might need to debounce onChange of each input field to reduce number of call to API too when validating too. Example when always throwing error inside custom resolver: https://stackblitz.com/edit/react-ts-kravh8?file=App.tsx |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm experiencing some weird issues with the
FormState
isValidating
with our bit more complex form after we changed changed our custom validation resolver to async function. It doesn't happen always but our e2e test became flaky after the change.I tried to reproduce it but it it is a bit flaky. However I managed to reproduce the issue couple times with this:
https://stackblitz.com/edit/react-ts-x44qv5?file=App.tsx
How to reproduce:
=> Sometimes the isValidating stays true
I'm bit unsure if we are using the resolver in non intended way so that is why I decided to start discussion before submitting an issue.
Beta Was this translation helpful? Give feedback.
All reactions