aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-docs/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/react-docs/src')
-rw-r--r--packages/react-docs/src/utils/typedoc_utils.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/react-docs/src/utils/typedoc_utils.ts b/packages/react-docs/src/utils/typedoc_utils.ts
index 21f2dcabb..02f5b4049 100644
--- a/packages/react-docs/src/utils/typedoc_utils.ts
+++ b/packages/react-docs/src/utils/typedoc_utils.ts
@@ -88,7 +88,7 @@ export const typeDocUtils = {
const classChildren = _.filter(packageDefinitionWithMergedChildren.children, (child: TypeDocNode) => {
return child.kindString === KindString.Class;
});
- if (classChildren.length > 1) {
+ if (classChildren.length > 1 && sectionName !== 'types') {
throw new Error('`react-docs` only supports projects with 1 exported class per file');
}
const isClassExport = packageDefinitionWithMergedChildren.children[0].kindString === KindString.Class;
@@ -183,6 +183,12 @@ export const typeDocUtils = {
}
break;
+ case KindString.Class:
+ // We currently do not support more then a single class per file
+ // except for the types section, where we ignore classes since we
+ // only want to render type definitions.
+ break;
+
default:
throw utils.spawnSwitchErr('kindString', entity.kindString);
}