From 28f077b16f5fc5f08f95bb2ad00724e6ea89dd00 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 23 Aug 2018 16:55:41 +0100 Subject: Add support for rending the Tuple type --- packages/react-docs/src/components/type.tsx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'packages/react-docs/src/components') 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 = (props: TypeProps): any => { }); break; + case TypeDocTypes.Tuple: + const tupleTypes = _.map(type.tupleElements, t => { + return ( + + ); + }); + typeName = ( +
+ [{_.reduce(tupleTypes, (prev: React.ReactNode, curr: React.ReactNode) => { + return [prev, ', ', curr]; + })}] +
+ ); + break; + default: throw errorUtils.spawnSwitchErr('type.typeDocType', type.typeDocType); } -- cgit v1.2.3