aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-docs/src/components
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-09-26 00:34:22 +0800
committerFabio Berger <me@fabioberger.com>2018-09-26 00:34:22 +0800
commitb40861747b73bb9a0826853751b7caa5cbf085ae (patch)
tree4c2d306da6265bacf1d476afe0531e38f25f287c /packages/react-docs/src/components
parentb73df28454bf72c0e68b1150ca6ee0ea3ead1382 (diff)
downloaddexon-sol-tools-b40861747b73bb9a0826853751b7caa5cbf085ae.tar
dexon-sol-tools-b40861747b73bb9a0826853751b7caa5cbf085ae.tar.gz
dexon-sol-tools-b40861747b73bb9a0826853751b7caa5cbf085ae.tar.bz2
dexon-sol-tools-b40861747b73bb9a0826853751b7caa5cbf085ae.tar.lz
dexon-sol-tools-b40861747b73bb9a0826853751b7caa5cbf085ae.tar.xz
dexon-sol-tools-b40861747b73bb9a0826853751b7caa5cbf085ae.tar.zst
dexon-sol-tools-b40861747b73bb9a0826853751b7caa5cbf085ae.zip
Properly render function generic types that don't extend another type
Diffstat (limited to 'packages/react-docs/src/components')
-rw-r--r--packages/react-docs/src/components/signature.tsx21
1 files changed, 13 insertions, 8 deletions
diff --git a/packages/react-docs/src/components/signature.tsx b/packages/react-docs/src/components/signature.tsx
index bf9c8be24..4f10f4665 100644
--- a/packages/react-docs/src/components/signature.tsx
+++ b/packages/react-docs/src/components/signature.tsx
@@ -134,14 +134,19 @@ function renderTypeParameter(
): React.ReactNode {
const typeParam = (
<span>
- {`<${typeParameter.name} extends `}
- <Type
- type={typeParameter.type}
- sectionName={sectionName}
- typeDefinitionByName={typeDefinitionByName}
- docsInfo={docsInfo}
- isInPopover={isInPopover}
- />
+ {`<${typeParameter.name}`}
+ {!_.isUndefined(typeParameter.type) && (
+ <span>
+ {' extends '}
+ <Type
+ type={typeParameter.type}
+ sectionName={sectionName}
+ typeDefinitionByName={typeDefinitionByName}
+ docsInfo={docsInfo}
+ isInPopover={isInPopover}
+ />
+ </span>
+ )}
{`>`}
</span>
);