react-docgen-typescript
Advanced tools
Comparing version
@@ -104,5 +104,6 @@ "use strict"; | ||
this.extractPropsFromTypeIfStatefulComponent(type); | ||
var resolvedComponentName = componentNameResolver(exp, source); | ||
var displayName = resolvedComponentName || computeComponentName(exp, source); | ||
var description = this.findDocComment(commentSource).fullComment; | ||
if (propsType) { | ||
var resolvedComponentName = componentNameResolver(exp, source); | ||
var componentName = resolvedComponentName || computeComponentName(exp, source); | ||
var defaultProps = this.extractDefaultPropsFromComponent(exp, source); | ||
@@ -113,3 +114,3 @@ var props = this.getPropsInfo(propsType, defaultProps); | ||
var prop = props[propName]; | ||
var component = { name: componentName }; | ||
var component = { name: displayName }; | ||
if (!this.propFilter(prop, component)) { | ||
@@ -120,7 +121,14 @@ delete props[propName]; | ||
return { | ||
description: this.findDocComment(commentSource).fullComment, | ||
displayName: componentName, | ||
description: description, | ||
displayName: displayName, | ||
props: props | ||
}; | ||
} | ||
else if (description && displayName) { | ||
return { | ||
description: description, | ||
displayName: displayName, | ||
props: {} | ||
}; | ||
} | ||
return null; | ||
@@ -127,0 +135,0 @@ }; |
{ | ||
"name": "react-docgen-typescript", | ||
"version": "1.10.0", | ||
"version": "1.11.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -171,2 +171,4 @@ # react-docgen-typescript | ||
**@JoaoMosmann** *João Mosmann* | ||
**@JocD** *Jacques Dukes* - complete support for functional components and much more | ||
@@ -182,2 +184,4 @@ | ||
**@mutsys** *Mike Rose* | ||
**@rkostrzewski** *Rafał Kostrzewski* | ||
@@ -195,4 +199,9 @@ | ||
**@thomascmost** *Thomas Constantine Moore* | ||
**@veiko** *Veronica Carrillo-Marquez* | ||
## Thanks to others | ||
The integration with React Styleguidist wouldn't be possible without [Vyacheslav Slinko](https://github.com/vslinko) pull request [#118](https://github.com/styleguidist/react-styleguidist/pull/118) at React Styleguidist. |
Sorry, the diff of this file is not supported yet
125340
0.4%1644
0.49%205
4.59%