Skip to content

Commit

Permalink
fix: add runtime to deps
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense committed Nov 7, 2018
1 parent 5a83695 commit ade68bb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 13 additions & 3 deletions examples/Api.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ class Api extends React.Component {

return i === list.length - 1 ? current : current.concat(' | ')
}, [])
case 'array':
case 'Array': {
case 'array': {
let child = this.renderType({ type: type.value })

return (
Expand All @@ -140,7 +139,18 @@ class Api extends React.Component {

renderEnum(enumType) {
const enumValues = enumType.value || []
return <code>{enumValues.join(' | ')}</code>
if (!Array.isArray(enumValues)) return enumValues

const renderedEnumValues = []
enumValues.forEach(({ value }, i) => {
if (i > 0) {
renderedEnumValues.push(<span key={`${i}c`}> | </span>)
}

renderedEnumValues.push(<code key={i}>{value}</code>)
})

return <span>{renderedEnumValues}</span>
}

renderControllableNote(prop, propName) {
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@
"webpack-dev-server": "^3.1.8"
},
"dependencies": {
"@babel/cli": "^7.1.0",
"@babel/runtime": "^7.0.0",
"classnames": "^2.2.6",
"date-arithmetic": "^3.0.0",
"dom-helpers": "^2.3.0 || ^3.0.0",
Expand Down

0 comments on commit ade68bb

Please sign in to comment.