diff --git a/addons/info/src/components/Story.js b/addons/info/src/components/Story.js index ed2d789dc2ba..bda0263d4bd5 100644 --- a/addons/info/src/components/Story.js +++ b/addons/info/src/components/Story.js @@ -14,6 +14,8 @@ import { Pre } from './markdown'; global.STORYBOOK_REACT_CLASSES = global.STORYBOOK_REACT_CLASSES || []; const { STORYBOOK_REACT_CLASSES } = global; +const getName = type => type.displayName || type.name; + const stylesheet = { button: { base: { @@ -324,14 +326,13 @@ export default class Story extends React.Component { extract(this.props.children); const array = Array.from(types.keys()); - array.sort((a, b) => (a.displayName || a.name) > (b.displayName || b.name)); + array.sort((a, b) => getName(a) > getName(b)); const { maxPropObjectKeys, maxPropArrayLength, maxPropStringLength } = this.props; - const propTables = array.map(type => ( -
+ Allow Duplicate DisplayNames for HOC #1814 +
++++++ + < + div + + + + > + +++ + < + Unknown + + + + /> + +++ + < + Unknown + + + + /> + +++ + </ + div + > + ++