Desde que actualicé Typescript versión 4.0 a 4.4 , recibo algunos errores con Generics y no puedo solucionarlos.
const isFirstData = <TFirst, TSecond>( item: { type: ItemType.FIRST; data: TFirst } | { type: ItemType.SECOND; data: TSecond } ): item is { type: ItemType.FIRST; data: TFirst } => item.type === ItemType.FIRST; const rows: ({ type: ItemType.SECOND; data: TSecond; } | { type: ItemType.FIRST; data: TFirst; })[]; const item = rows[0]; const height = isFirstData(item) ? First?.value : Second?.value; // Argument of type '{ type: ItemType.SECOND; data: TData; } | { type: ItemType.FIRST; data: TFirst; }' is not assignable to parameter of type '{ type: ItemType.FIRST; data: TData; } | { type: ItemType.SECOND; data: TData; }'.¿Alguien puede explicar qué ha cambiado en mecanografiado y cómo solucionar mi error?