react-docgen-typescript
Advanced tools
Comparing version
@@ -379,3 +379,3 @@ "use strict"; | ||
description: 'regularProp description', | ||
required: true, | ||
required: false, | ||
type: 'string' | ||
@@ -398,2 +398,5 @@ }, | ||
}); | ||
it('supports typescript 3.0 style defaulted props', function () { | ||
testUtils_1.check('StatelessWithDefaultPropsTypescript3', expectation); | ||
}); | ||
}); | ||
@@ -400,0 +403,0 @@ it('should parse functional component component defined as function', function () { |
@@ -314,4 +314,5 @@ "use strict"; | ||
var jsDocComment = _this.findDocComment(prop); | ||
var hasCodeBasedDefault = defaultProps[propName] !== undefined; | ||
var defaultValue = null; | ||
if (defaultProps[propName] !== undefined) { | ||
if (hasCodeBasedDefault) { | ||
defaultValue = { value: defaultProps[propName] }; | ||
@@ -328,3 +329,3 @@ } | ||
parent: parent, | ||
required: !isOptional, | ||
required: !isOptional && !hasCodeBasedDefault, | ||
type: _this.getDocgenType(propType) | ||
@@ -331,0 +332,0 @@ }; |
{ | ||
"name": "react-docgen-typescript", | ||
"version": "1.14.0", | ||
"version": "1.14.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/styleguidist/react-docgen-typescript/", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
150376
0.27%1975
0.2%