The DatasetV2 type is not compatible with Owned, even though it is composed with it.
See the example fiddle. I would expect dataset to be compatible with the signature of useMyComposable but there's the following error:
Argument of type 'DatasetV2' is not assignable to parameter of type 'Owned'.
Type 'DatasetV2' is not assignable to type '{ organization: null; owner: User; }'.
Types of property 'organization' are incompatible.
Type 'Organization | null' is not assignable to type 'null'.
Type 'Organization' is not assignable to type 'null'.
For reference, a Owned like this would work (but less smart):
interface Owned {
organization?: Organization | null;
owner?: User | null;
}
The
DatasetV2type is not compatible withOwned, even though it is composed with it.See the example fiddle. I would expect
datasetto be compatible with the signature ofuseMyComposablebut there's the following error:For reference, a
Ownedlike this would work (but less smart):