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
Is your feature request related to a problem? Please describe.
I'm using yupResolver in synchronous mode. The problem I'm facing is that although the schema is correctly invoked via yup's validateSync, yupResolver still returns a promise.
That's not a problem when yupResolver is invoked directly via useHook's resolve (because it uses await on resolve), but it does become a problem when running yupResolve outside of the form context, because I need to use async/await on the entire execution chain of leading up to yupResolve.
Why am I using yupResolve outside of the form? Because I'm validating the form data before displaying the form, and I'm trying to use the same higher-level validation method that is based on yupResolve.
Describe the solution you'd like
It would be great if yupResolver would return a regular (resolved) result instead of a promise when called with mode='sync' to support a use case where yupResolver is executed synchronously also outside of useForm().
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I'm using
yupResolver
in synchronous mode. The problem I'm facing is that although the schema is correctly invoked via yup'svalidateSync
,yupResolver
still returns a promise.That's not a problem when
yupResolver
is invoked directly via useHook's resolve (because it usesawait
onresolve
), but it does become a problem when runningyupResolve
outside of the form context, because I need to use async/await on the entire execution chain of leading up toyupResolve
.Why am I using
yupResolve
outside of the form? Because I'm validating the form data before displaying the form, and I'm trying to use the same higher-level validation method that is based onyupResolve
.Describe the solution you'd like
It would be great if
yupResolver
would return a regular (resolved) result instead of a promise when called with mode='sync' to support a use case where yupResolver is executed synchronously also outside of useForm().The text was updated successfully, but these errors were encountered: