diff --git a/src/components/components-extractor.ts b/src/components/components-extractor.ts index 67c2fe5..5ef61ae 100644 --- a/src/components/components-extractor.ts +++ b/src/components/components-extractor.ts @@ -12,7 +12,8 @@ function returnsReactContent(node: DeclarationReflection) { return node.signatures?.some( ({ type }) => schema.types.isReferenceType(type) && - (type.symbolFullyQualifiedName === 'global.JSX.Element' || type.symbolFullyQualifiedName === 'React.ReactPortal') + (type.symbolFullyQualifiedName.endsWith('JSX.Element') || + type.symbolFullyQualifiedName.endsWith('React.ReactPortal')) ); } diff --git a/src/schema/utils.ts b/src/schema/utils.ts index be9f659..d173632 100644 --- a/src/schema/utils.ts +++ b/src/schema/utils.ts @@ -12,12 +12,13 @@ export function isOptionalDeclaration(prop: DeclarationReflection): boolean { } export function isForwardRefDeclaration({ type, name }: DeclarationReflection): boolean { - const isForwardRef = isReferenceType(type) && type.symbolFullyQualifiedName === 'React.ForwardRefExoticComponent'; + const isForwardRef = + isReferenceType(type) && type.symbolFullyQualifiedName.endsWith('React.ForwardRefExoticComponent'); const isParametrizedForwardRef = Boolean( isReferenceType(type) && type.name === `${name}ForwardRefType` && (type.reflection as DeclarationReflection | undefined)?.signatures?.some(({ name, type }) => { - return name === '__call' && isReferenceType(type) && type.symbolFullyQualifiedName === 'global.JSX.Element'; + return name === '__call' && isReferenceType(type) && type.symbolFullyQualifiedName.endsWith('JSX.Element'); }) ); return isForwardRef || isParametrizedForwardRef;