diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 03302ec5f32..14e789f17ae 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13549,17 +13549,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); - } - return getApparentType(propsType); + if (!propsType) { + return undefined; } - return propsType; + if (propsType.flags & TypeFlags.Intersection) { + const propsApparentType: Type[] = []; + for (const t of (propsType).types) { + propsApparentType.push(getApparentType(t)); + } + return getIntersectionType(propsApparentType); + } + return getApparentType(propsType); } /**