aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-docs
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-03-16 21:02:55 +0800
committerFabio Berger <me@fabioberger.com>2018-03-16 21:02:55 +0800
commit5175fe8107d4cad17617230ec32268c5f226c26f (patch)
tree4728f91e3c28136920c0a00993fd0e86c028bac1 /packages/react-docs
parent8d1e27a1a53f4c88ec9fefb5fd37b30c652782a6 (diff)
downloaddexon-sol-tools-5175fe8107d4cad17617230ec32268c5f226c26f.tar
dexon-sol-tools-5175fe8107d4cad17617230ec32268c5f226c26f.tar.gz
dexon-sol-tools-5175fe8107d4cad17617230ec32268c5f226c26f.tar.bz2
dexon-sol-tools-5175fe8107d4cad17617230ec32268c5f226c26f.tar.lz
dexon-sol-tools-5175fe8107d4cad17617230ec32268c5f226c26f.tar.xz
dexon-sol-tools-5175fe8107d4cad17617230ec32268c5f226c26f.tar.zst
dexon-sol-tools-5175fe8107d4cad17617230ec32268c5f226c26f.zip
Handle reflection type in type rendering
Diffstat (limited to 'packages/react-docs')
-rw-r--r--packages/react-docs/CHANGELOG.md1
-rw-r--r--packages/react-docs/src/components/type.tsx14
2 files changed, 15 insertions, 0 deletions
diff --git a/packages/react-docs/CHANGELOG.md b/packages/react-docs/CHANGELOG.md
index a90cf19f0..7f860739f 100644
--- a/packages/react-docs/CHANGELOG.md
+++ b/packages/react-docs/CHANGELOG.md
@@ -4,3 +4,4 @@
* Move example out into a separate sub-package
* Consolidate all `console.log` calls into `logUtils` in the `@0xproject/utils` package (#452)
+ * Handle `reflection` type rendering so that anonymous function type declarations render properly
diff --git a/packages/react-docs/src/components/type.tsx b/packages/react-docs/src/components/type.tsx
index 56425a5df..b253f0397 100644
--- a/packages/react-docs/src/components/type.tsx
+++ b/packages/react-docs/src/components/type.tsx
@@ -9,6 +9,7 @@ import { Type as TypeDef, TypeDefinitionByName, TypeDocTypes } from '../types';
import { constants } from '../utils/constants';
import { utils } from '../utils/utils';
+import { MethodSignature } from './method_signature';
import { TypeDefinition } from './type_definition';
const typeToSection: { [typeName: string]: string } = {
@@ -101,6 +102,19 @@ export function Type(props: TypeProps): any {
});
break;
+ case TypeDocTypes.Reflection:
+ typeName = (
+ <MethodSignature
+ method={type.method}
+ sectionName={props.sectionName}
+ shouldHideMethodName={true}
+ shouldUseArrowSyntax={true}
+ docsInfo={props.docsInfo}
+ typeDefinitionByName={props.typeDefinitionByName}
+ />
+ );
+ break;
+
case TypeDocTypes.TypeParameter:
typeName = type.name;
break;