Skip to content

Commit ade68bb

Browse files
committed
fix: add runtime to deps
1 parent 5a83695 commit ade68bb

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

examples/Api.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ class Api extends React.Component {
117117

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

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

141140
renderEnum(enumType) {
142141
const enumValues = enumType.value || []
143-
return <code>{enumValues.join(' | ')}</code>
142+
if (!Array.isArray(enumValues)) return enumValues
143+
144+
const renderedEnumValues = []
145+
enumValues.forEach(({ value }, i) => {
146+
if (i > 0) {
147+
renderedEnumValues.push(<span key={`${i}c`}> | </span>)
148+
}
149+
150+
renderedEnumValues.push(<code key={i}>{value}</code>)
151+
})
152+
153+
return <span>{renderedEnumValues}</span>
144154
}
145155

146156
renderControllableNote(prop, propName) {

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@
103103
"webpack-dev-server": "^3.1.8"
104104
},
105105
"dependencies": {
106+
"@babel/cli": "^7.1.0",
107+
"@babel/runtime": "^7.0.0",
106108
"classnames": "^2.2.6",
107109
"date-arithmetic": "^3.0.0",
108110
"dom-helpers": "^2.3.0 || ^3.0.0",

0 commit comments

Comments
 (0)