在下面的示例中,我希望确保返回的类型与泛型函数中给定的泛型类型相对应。不幸的是,当使用result instanceof T时,TypeScript报告以下错误:error TS2693: 'T' only refers to a type, but is being used有没有办法在运行时检查对象的类型
Type 'Reducer<RouterState<unknown>, AnyAction>' is not assignable to type 'Reducer<unknown, AnyActionType 'unknown' is not assignable to type 'RouterState<unknown>'. }