We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug In yup 0.32 type Lazy in incompatible with type BaseSchema
To Reproduce
steps: Yup.object().shape({ childNodes: Yup.array().of( Yup.object().shape({ meta: Yup.object().shape({ data: Yup.object().shape({ name: Yup.string().required('Step name is a required field'), type: Yup.string().required('Step type is a required field'), }), }), childNodes: Yup.array().of( Yup.lazy((value: any): any => { if (value.title === 'Requests:') { return Yup.object().shape({ childNodes: Yup.array().of(RequestsSchema) }); } return Yup.object().shape({ childNodes: Yup.array().of(TargetSchema) }); }) ), }) ), }),
Expected behavior No types error
I removed @types/yup, upgraded to yup 0.32.1, added "strictFunctionTypes": false, "strictNullChecks": true in tsconfig.json
"strictFunctionTypes": false, "strictNullChecks": true
The text was updated successfully, but these errors were encountered:
ba92dfc
lazy
array().of
Thanks to this comment, I made it work.
I agree that putting casting as any is not the best solution, but at least it gets the job done.
Sorry, something went wrong.
No branches or pull requests
Describe the bug
In yup 0.32 type Lazy in incompatible with type BaseSchema
To Reproduce
Expected behavior
No types error
I removed @types/yup, upgraded to yup 0.32.1, added
"strictFunctionTypes": false, "strictNullChecks": true
in tsconfig.jsonThe text was updated successfully, but these errors were encountered: