Skip to content

Commit

Permalink
Merge branch 'master' into greenkeeper/lerna-2.0.0-rc.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen authored Apr 28, 2017
2 parents d8b9a17 + 691b55e commit 42b6f41
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/addon-info/src/components/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ function getData(element) {
text: null,
children: null,
};

if (typeof element === 'null') {
return data
}

if (typeof element == 'string') {
data.text = element;
Expand Down
5 changes: 4 additions & 1 deletion packages/addon-info/src/components/PropTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ 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';
props[property] = { property, propType, required };
const description = type.__docgenInfo && type.__docgenInfo.props && type.__docgenInfo.props[property] ? type.__docgenInfo.props[property].description : null;
props[property] = { property, propType, required, description };
}
}

Expand Down Expand Up @@ -72,6 +73,7 @@ export default class PropTable extends React.Component {
<th>propType</th>
<th>required</th>
<th>default</th>
<th>description></th>
</tr>
</thead>
<tbody>
Expand All @@ -81,6 +83,7 @@ export default class PropTable extends React.Component {
<td>{row.propType}</td>
<td>{row.required}</td>
<td>{row.defaultValue === undefined ? '-' : <PropVal val={row.defaultValue} />}</td>
<td>{row.description}</td>
</tr>
))}
</tbody>
Expand Down

0 comments on commit 42b6f41

Please sign in to comment.