Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Aug 7, 2017

Conversation

loklaan
Copy link
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
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