diff options
Diffstat (limited to 'packages/react-docs/src/components')
-rw-r--r-- | packages/react-docs/src/components/type.tsx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/packages/react-docs/src/components/type.tsx b/packages/react-docs/src/components/type.tsx index 145c797a3..5f7601ce1 100644 --- a/packages/react-docs/src/components/type.tsx +++ b/packages/react-docs/src/components/type.tsx @@ -167,6 +167,28 @@ export const Type: React.SFC<TypeProps> = (props: TypeProps): any => { }); break; + case TypeDocTypes.Tuple: + const tupleTypes = _.map(type.tupleElements, t => { + return ( + <Type + key={`type-tuple-${t.name}-${t.typeDocType}`} + type={t} + sectionName={props.sectionName} + typeDefinitionByName={props.typeDefinitionByName} + docsInfo={props.docsInfo} + isInPopover={props.isInPopover} + /> + ); + }); + typeName = ( + <div> + [{_.reduce(tupleTypes, (prev: React.ReactNode, curr: React.ReactNode) => { + return [prev, ', ', curr]; + })}] + </div> + ); + break; + default: throw errorUtils.spawnSwitchErr('type.typeDocType', type.typeDocType); } |