Closed Mrowa96 closed 1 year ago
I'm also facing this issue, is there any update or workaround?
I'm also running in to this. In my case, I have a schema that is concatinated with another one under certain condition. I use 'lazy' to wrap this conditional logic. When I pass the lazy schema into the resolver, conditional validation works as intendent but Typescript is complaining like @Mrowa96 mentioned.
Codesandbox example https://codesandbox.io/p/sandbox/yupresolver-lazy-inference-nrmgz6
Released in 3.3.0
Describe the bug When passing
yup.Lazy
object as a parameter toyupResolver
it gives us error that we are not passing expected type as a parameter.To Reproduce Please check code sandbox, it's a type error not runtime one.
Codesandbox link (Required) https://codesandbox.io/s/weathered-snowflake-wj71vi?file=/src/logic.ts
Expected behavior Passing
yup.Lazy
should not generate any type issues.Screenshots