Skip to content

Commit

Permalink
Merge pull request #16 from kadirahq/show-default-props-enhanced
Browse files Browse the repository at this point in the history
Display more info on default props
  • Loading branch information
roonyh authored Jun 24, 2016
2 parents 1b90f7a + 3704527 commit 51f029b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/PropTable.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import PropVal from './PropVal'

const PropTypesMap = new Map();
for (let typeName in React.PropTypes) {
Expand Down Expand Up @@ -27,8 +28,7 @@ export default class PropTable extends React.Component {
const typeInfo = type.propTypes[property];
const propType = PropTypesMap.get(typeInfo) || 'other';
const required = typeInfo.isRequired === undefined ? 'yes' : 'no';
const defaultValue = '-';
props[property] = {property, propType, required, defaultValue};
props[property] = {property, propType, required};
}
}

Expand Down Expand Up @@ -72,7 +72,7 @@ export default class PropTable extends React.Component {
<td>{row.property}</td>
<td>{row.propType}</td>
<td>{row.required}</td>
<td>{row.defaultValue.toString()}</td>
<td>{row.defaultValue === undefined ? '-' : <PropVal val={row.defaultValue} />}</td>
</tr>
))}
</tbody>
Expand Down

0 comments on commit 51f029b

Please sign in to comment.