diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 43574b02f3e02..86d81df431659 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13468,17 +13468,17 @@ namespace ts { } function getApparentTypeOfJsxPropsType(propsType: Type): Type { - if (propsType) { - if (propsType.flags & TypeFlags.Intersection) { - const propsApprentType: Type[] = []; - for (const t of (propsType).types) { - propsApprentType.push(getApparentType(t)); - } - return getIntersectionType(propsApprentType); + if (!propsType) { + return undefined; + } + if (propsType.flags & TypeFlags.Intersection) { + const propsApparentType: Type[] = []; + for (const t of (propsType).types) { + propsApparentType.push(getApparentType(t)); } - return getApparentType(propsType); + return getIntersectionType(propsApparentType); } - return propsType; + return getApparentType(propsType); } /**