From 7d9c6eafbfd8434c92737a0e9edf8e610984ac90 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 11 Apr 2018 16:53:13 +0900 Subject: Add support for nested methods within type declarations. Make sure they render without a callPath. --- packages/react-docs/src/components/interface.tsx | 3 +-- packages/react-docs/src/components/type.tsx | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'packages/react-docs/src/components') diff --git a/packages/react-docs/src/components/interface.tsx b/packages/react-docs/src/components/interface.tsx index 541e164e3..bdfdf47c4 100644 --- a/packages/react-docs/src/components/interface.tsx +++ b/packages/react-docs/src/components/interface.tsx @@ -19,7 +19,7 @@ export function Interface(props: InterfaceProps) { return ( {property.name}:{' '} - {property.type.typeDocType !== TypeDocTypes.Reflection ? ( + {property.type && property.type.typeDocType !== TypeDocTypes.Reflection ? ( ) : ( Date: Wed, 11 Apr 2018 17:36:01 +0900 Subject: Add missing space in property declaration --- packages/react-docs/src/components/documentation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/react-docs/src/components') diff --git a/packages/react-docs/src/components/documentation.tsx b/packages/react-docs/src/components/documentation.tsx index 14fe175cf..800892dc8 100644 --- a/packages/react-docs/src/components/documentation.tsx +++ b/packages/react-docs/src/components/documentation.tsx @@ -337,7 +337,7 @@ export class Documentation extends React.Component - {property.name}: + {property.name}:{' '} {property.source && ( -- cgit v1.2.3 From bce97c2543d8f1f4fef3e65086d25ed37977b361 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 11 Apr 2018 17:39:30 +0900 Subject: Add support for displaying default param values --- packages/react-docs/src/components/signature.tsx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'packages/react-docs/src/components') diff --git a/packages/react-docs/src/components/signature.tsx b/packages/react-docs/src/components/signature.tsx index 83fb1e246..1d3c90261 100644 --- a/packages/react-docs/src/components/signature.tsx +++ b/packages/react-docs/src/components/signature.tsx @@ -91,6 +91,7 @@ function renderParameters( ) { const params = _.map(parameters, (p: Parameter) => { const isOptional = p.isOptional; + const hasDefaultValue = !_.isUndefined(p.defaultValue); const type = ( {p.name} {isOptional && '?'}: {type} + {hasDefaultValue && ` = ${p.defaultValue}`} ); }); -- cgit v1.2.3