Allow JSX attributes to be union types

This commit is contained in:
Kanchalai Tanglertsampan 2017-02-21 14:28:46 -08:00
parent dca368b719
commit 994ddacae2

View file

@ -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<T> and IntrinsicElements
let apparentAttributesType = attributesType;