Skip to content

Commit 994ddac

Browse files
author
Kanchalai Tanglertsampan
committed
Allow JSX attributes to be union types
1 parent dca368b commit 994ddac

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/compiler/checker.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12754,11 +12754,6 @@ namespace ts {
1275412754
// Props is of type 'any' or unknown
1275512755
return attributesType;
1275612756
}
12757-
else if (attributesType.flags & TypeFlags.Union) {
12758-
// Props cannot be a union type
12759-
error(openingLikeElement.tagName, Diagnostics.JSX_element_attributes_type_0_may_not_be_a_union_type, typeToString(attributesType));
12760-
return anyType;
12761-
}
1276212757
else {
1276312758
// Normal case -- add in IntrinsicClassElements<T> and IntrinsicElements
1276412759
let apparentAttributesType = attributesType;

0 commit comments

Comments
 (0)