error TS2769: No overload matches this call.
Overload 1 of 4, '(keys: string | string[], builder: ConditionBuilder<DateSchema<Date | null, AnyObject, undefined, "">>): DateSchema<Date | null, AnyObject, undefined, "">', gave the following error.
Argument of type '(endDate: Date, schema: DateSchema<Date | null, AnyObject, undefined, "">) => DateSchema<Date | null, AnyObject, undefined, "">' is not assignable to parameter of type 'ConditionBuilder<DateSchema<Date | null, AnyObject, undefined, "">>'.
Types of parameters 'endDate' and 'values' are incompatible.
Type 'any[]' is missing the following properties from type 'Date': toDateString, toTimeString, toLocaleDateString, toLocaleTimeString, and 38 more.
Overload 2 of 4, '(keys: string | string[], options: ConditionConfig<DateSchema<Date | null, AnyObject, undefined, "">>): DateSchema<Date | null, AnyObject, undefined, "">', gave the following error.
Argument of type '(endDate: Date, schema: DateSchema<Date | null, AnyObject, undefined, "">) => DateSchema<Date | null, AnyObject, undefined, "">' is not assignable to parameter of type 'ConditionConfig<DateSchema<Date | null, AnyObject, undefined, "">>'.
Property 'is' is missing in type '(endDate: Date, schema: DateSchema<Date | null, AnyObject, undefined, "">) => DateSchema<Date | null, AnyObject, undefined, "">' but required in type 'ConditionConfig<DateSchema<Date | null, AnyObject, undefined, "">>'.
@jquense I wasn't sure if the issue was related to this or not.
https://github.com/jquense/yup/pull/1924
I have problems every time I add the second when condition.
MY error message
Thanks in advance for the answer.