Skip to content

Commit

Permalink
Fix info addon prop tables (#1607)
Browse files Browse the repository at this point in the history
Prop Tables were being key'd by their component's object `name` prop; this means that only the first component, of many components of the same type, would show.

Making sure we first check `displayName` for key usage means that components with the same type can all appear in the Prop Tables if their individual `displayName`'s were different.

Case: Higher Order Components
  • Loading branch information
loklaan authored and Hypnosphi committed Aug 7, 2017
1 parent 89b6b41 commit 094459a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/info/src/components/Story.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ export default class Story extends React.Component {

const { maxPropObjectKeys, maxPropArrayLength, maxPropStringLength } = this.props;
const propTables = array.map(type =>
<div key={type.name}>
<div key={type.displayName || type.name}>
<h2 style={this.state.stylesheet.propTableHead}>
"{type.displayName || type.name}" Component
</h2>
Expand Down

0 comments on commit 094459a

Please sign in to comment.