Skip to content

Commit a4afdef

Browse files
Sebastian WendorfSebastian Wendorf
authored andcommitted
Fixed React Component detection
1 parent 7922547 commit a4afdef

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

typescript/src/react/post-processors/react-component.post-processor.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class ReactComponentPostProcessor extends PostProcessor {
1616
// Function Components (standard functions)
1717
const allFunctions: LCEFunctionDeclaration[] = (concepts.get(LCEFunctionDeclaration.conceptId) ?? []) as LCEFunctionDeclaration[];
1818
for (const func of allFunctions) {
19-
if (func.returnType instanceof LCETypeDeclared && isComponentReturnType(func.returnType)) {
19+
if (isComponentReturnType(func.returnType)) {
2020
const component = new LCEReactComponent(func.fqn, func.functionName, []);
2121
if (func.metadata.has(JSXDependencyContextProcessor.JSX_DEPENDENCY_METADATA)) {
2222
component.renderedElements.push(...func.metadata.get(JSXDependencyContextProcessor.JSX_DEPENDENCY_METADATA));
@@ -30,7 +30,6 @@ export class ReactComponentPostProcessor extends PostProcessor {
3030
for (const variable of allVariables) {
3131
if (
3232
(variable.type instanceof LCETypeFunction &&
33-
variable.type.returnType instanceof LCETypeDeclared &&
3433
isComponentReturnType(variable.type.returnType)) ||
3534
(variable.type instanceof LCETypeDeclared && isReactFunctionComponentType(variable.type.fqn.globalFqn))
3635
) {

0 commit comments

Comments
 (0)