Skip to content

Commit 9bb0a54

Browse files
committed
Reset file
1 parent f2176a8 commit 9bb0a54

File tree

1 file changed

+3
-22
lines changed

1 file changed

+3
-22
lines changed

packages/react-docgen/src/utils/getTypeFromReactComponent.ts

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -184,28 +184,9 @@ export function applyToTypeProperties(
184184
(typesPath) =>
185185
applyToTypeProperties(documentation, typesPath, callback, typeParams),
186186
);
187-
} else if (path.isParenthesizedExpression() || path.isTSParenthesizedType()) {
188-
const typeAnnotation = path.get('typeAnnotation');
189-
const typeAnnotationPath = Array.isArray(typeAnnotation)
190-
? typeAnnotation[0]
191-
: typeAnnotation;
192-
193-
if (typeAnnotationPath) {
194-
applyToTypeProperties(
195-
documentation,
196-
typeAnnotationPath,
197-
callback,
198-
typeParams,
199-
);
200-
}
201-
} else if (path.isUnionTypeAnnotation() || path.isTSUnionType()) {
202-
const typeNodes = path.get('types');
203-
const types = Array.isArray(typeNodes) ? typeNodes : [typeNodes];
204-
205-
types.forEach((typesPath) =>
206-
applyToTypeProperties(documentation, typesPath, callback, typeParams),
207-
);
208-
} else {
187+
} else if (!path.isUnionTypeAnnotation()) {
188+
// The react-docgen output format does not currently allow
189+
// for the expression of union types
209190
const typePath = resolveGenericTypeAnnotation(path);
210191

211192
if (typePath) {

0 commit comments

Comments
 (0)