fix: add key for OneOfType

This commit is contained in:
Billy Vong 2017-09-05 10:06:14 -07:00
parent 738a8c50a9
commit c90b09eea1

View File

@ -9,7 +9,10 @@ const OneOfType = ({ propType }) => {
<span>
{propType.value
.map((value, i) => [
<PrettyPropType propType={value} />,
<PrettyPropType
key={`${value.name}${value.value ? `-${value.value}` : ''}`}
propType={value}
/>,
i < length - 1 ? <span> | </span> : null,
])
.reduce((acc, tuple) => acc.concat(tuple), [])}