Passing Default Schema Argument in TypeScript Function
Hey, How can pass default schema as default argument in typescript :
export function withAuthPageRequired<A, I, A2, I2, A3, I3>(
Comp: React.FC<{ params: A; session: Session }>,
schema: S.Schema<A, I>,
profilSchema: S.Schema<A2, I2>,
searchParamSchema: S.Schema<A3, I3> = S.Unknown, // <- Type 'typeof Unknown' is not assignable to type 'Schema<A3, I3, never>'.
//. Types of property 'Type' are incompatible.
// Type 'unknown' is not assignable to type 'A3'.
) {export function withAuthPageRequired<A, I, A2, I2, A3, I3>(
Comp: React.FC<{ params: A; session: Session }>,
schema: S.Schema<A, I>,
profilSchema: S.Schema<A2, I2>,
searchParamSchema: S.Schema<A3, I3> = S.Unknown, // <- Type 'typeof Unknown' is not assignable to type 'Schema<A3, I3, never>'.
//. Types of property 'Type' are incompatible.
// Type 'unknown' is not assignable to type 'A3'.
) {