From 994ddacae20b8759dc7cab6b1c5b48f6025316aa Mon Sep 17 00:00:00 2001 From: Kanchalai Tanglertsampan Date: Tue, 21 Feb 2017 14:28:46 -0800 Subject: [PATCH] Allow JSX attributes to be union types --- src/compiler/checker.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 12b55aa818b..5fe3a0de1a5 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -12754,11 +12754,6 @@ namespace ts { // Props is of type 'any' or unknown return attributesType; } - else if (attributesType.flags & TypeFlags.Union) { - // Props cannot be a union type - error(openingLikeElement.tagName, Diagnostics.JSX_element_attributes_type_0_may_not_be_a_union_type, typeToString(attributesType)); - return anyType; - } else { // Normal case -- add in IntrinsicClassElements and IntrinsicElements let apparentAttributesType = attributesType;