Skip to content

Commit

Permalink
components support flowtype (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
walesey authored Apr 28, 2020
1 parent 1a58233 commit 0ab8ca9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions component.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ var parseReact = function (filePath, doclet) {
props: Object.entries(docGen.props || {}).map(([key, prop]) => ({
name: key,
description: prop.description,
type: prop.type.name,
type: prop.type ? prop.type.name : prop.flowType.name,
required: typeof prop.required === 'boolean' && prop.required,
defaultValue: prop.defaultValue
? (prop.defaultValue.computed ? 'function()' : prop.defaultValue.value)
Expand All @@ -92,7 +92,7 @@ var parseVue = function (filePath, doclet) {
props: Object.values(docGen.props || {}).map(prop => ({
name: prop.name,
description: prop.description,
type: prop.type.name,
type: prop.type ? prop.type.name : prop.flowType.name,
required: typeof prop.required === 'boolean' && prop.required,
defaultValue: prop.defaultValue
? (prop.defaultValue.func ? 'function()' : prop.defaultValue.value)
Expand Down

0 comments on commit 0ab8ca9

Please sign in to comment.