aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-docs/src/components
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-09-28 02:43:10 +0800
committerFabio Berger <me@fabioberger.com>2018-09-28 02:43:10 +0800
commita6672e0190573c65f2c36e303d49f0389f5a9a26 (patch)
treee2b51cbcb726a2ddf6ab248ee3763e8b8f8b7218 /packages/react-docs/src/components
parent5347bf587fcdcfa5c08b016f3626462d67c43340 (diff)
downloaddexon-sol-tools-a6672e0190573c65f2c36e303d49f0389f5a9a26.tar
dexon-sol-tools-a6672e0190573c65f2c36e303d49f0389f5a9a26.tar.gz
dexon-sol-tools-a6672e0190573c65f2c36e303d49f0389f5a9a26.tar.bz2
dexon-sol-tools-a6672e0190573c65f2c36e303d49f0389f5a9a26.tar.lz
dexon-sol-tools-a6672e0190573c65f2c36e303d49f0389f5a9a26.tar.xz
dexon-sol-tools-a6672e0190573c65f2c36e303d49f0389f5a9a26.tar.zst
dexon-sol-tools-a6672e0190573c65f2c36e303d49f0389f5a9a26.zip
Don't render colon for auto-generated getters
Diffstat (limited to 'packages/react-docs/src/components')
-rw-r--r--packages/react-docs/src/components/signature.tsx9
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/react-docs/src/components/signature.tsx b/packages/react-docs/src/components/signature.tsx
index aa174042c..266bfe3dd 100644
--- a/packages/react-docs/src/components/signature.tsx
+++ b/packages/react-docs/src/components/signature.tsx
@@ -118,9 +118,14 @@ function renderParameters(
/>
);
return (
- <span key={`param-${p.type}-${p.name}`}>
+ <span key={`param-${JSON.stringify(p.type)}-${name}-${i}`}>
+ {!_.isEmpty(p.name) && (
+ <span>
{p.name}
- {isOptional && '?'}: {type}
+ {isOptional && '?'}:{' '}
+ </span>
+ )}
+ {type}
{hasDefaultValue && ` = ${p.defaultValue}`}
</span>
);