diff options
author | Fabio Berger <me@fabioberger.com> | 2018-09-28 02:43:10 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-09-28 02:43:10 +0800 |
commit | a6672e0190573c65f2c36e303d49f0389f5a9a26 (patch) | |
tree | e2b51cbcb726a2ddf6ab248ee3763e8b8f8b7218 /packages/react-docs/src | |
parent | 5347bf587fcdcfa5c08b016f3626462d67c43340 (diff) | |
download | dexon-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')
-rw-r--r-- | packages/react-docs/src/components/signature.tsx | 9 |
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> ); |