Skip to content

Commit d75b484

Browse files
committed
Do not mix changes
1 parent a8d4b25 commit d75b484

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

Diff for: packages/react-docgen/src/utils/getTypeFromReactComponent.ts

-17
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import type {
1212
FlowType,
1313
InterfaceDeclaration,
1414
InterfaceExtends,
15-
Node,
1615
TSExpressionWithTypeArguments,
1716
TSInterfaceDeclaration,
1817
TSType,
@@ -42,17 +41,6 @@ function getStatelessPropsPath(
4241
return value.get('params')[0];
4342
}
4443

45-
function getForwardRefGenericsType(componentDefinition: NodePath) {
46-
const typeParameters = componentDefinition.get(
47-
'typeParameters',
48-
) as NodePath<Node>;
49-
if (typeParameters && typeParameters.hasNode()) {
50-
const params = typeParameters.get('params') as NodePath<Node>[];
51-
return params[1] ?? null;
52-
}
53-
return null;
54-
}
55-
5644
function findAssignedVariableType(
5745
componentDefinition: NodePath,
5846
): NodePath | null {
@@ -118,11 +106,6 @@ export default (componentDefinition: NodePath): NodePath[] => {
118106
}
119107
}
120108
} else {
121-
const typeAnnotation = getForwardRefGenericsType(componentDefinition);
122-
if (typeAnnotation) {
123-
typePaths.push(typeAnnotation);
124-
}
125-
126109
const propsParam = getStatelessPropsPath(componentDefinition);
127110

128111
if (propsParam) {

0 commit comments

Comments
 (0)