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
Property 'validate' does not exist on type 'Reference<string> | ISchema<string, AnyObject, any, any>'.
Property 'validate' does not exist on type 'Reference<string>'.ts(2339)
Expected behavior
No type error for reach when trying to run validate
Platform (please complete the following information):
TypeScript 5.3.3
Version 1.3.3
The text was updated successfully, but these errors were encountered:
Seeing this as well. We used to be able to use yup.reach(MySchema).isValidSync(), but now it seems that the type returned is Reference<T> | ISchema<T, AnyObject, any, any> as noted above, instead of a Schema. We're currently casting the result of reach into a Schema as a workaround, but is there any guidance on this?
edit: Mine is a separate issue. Since reach now returns a Reference or an ISchema, I think you can get away with narrowing the type by using Reference.isRef, if you don't want to cast the result.
Describe the bug
The TypeScript type definitions for the
validate
method onreach()
return seem to be missing, resulting in a compilation error.To Reproduce
Project to reproduce the type error: https://github.com/juancarlosjr97/yup-schema-validation-reach/blob/main/index.ts#L7
The error on TypeScript is
Expected behavior
No type error for reach when trying to run validate
Platform (please complete the following information):
The text was updated successfully, but these errors were encountered: