Skip to content

[Info Addon] Enable many components of same type in prop tables#1607

Merged
Hypnosphi merged 1 commit intostorybookjs:masterfrom
loklaan:patch-1
Aug 7, 2017
Merged

[Info Addon] Enable many components of same type in prop tables#1607
Hypnosphi merged 1 commit intostorybookjs:masterfrom
loklaan:patch-1

Conversation

@loklaan
Copy link
Copy Markdown
Member

@loklaan loklaan commented Aug 7, 2017

Issue: Could not show components in Prop Tables if they had the same type.name prop.

What I did

Use the displayName as a key for the Prop Tables instead.

More

Case: Higher Order Components

Previously the keying of Tables was done with the name prop of the component type. This inadvertently filtered out all other components that had the same name value. eg Higher Order Components.

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 are different.

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
@loklaan loklaan changed the title [Info Addon] Enable many components of same type prop tables [Info Addon] Enable many components of same type in prop tables Aug 7, 2017
@Hypnosphi Hypnosphi self-assigned this Aug 7, 2017
@Hypnosphi Hypnosphi self-requested a review August 7, 2017 18:46
Copy link
Copy Markdown
Member

@Hypnosphi Hypnosphi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Hypnosphi Hypnosphi merged commit 094459a into storybookjs:master Aug 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants