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

Addon-docs: Support subcomponents as a top-level default export #8931

Merged
merged 1 commit into from
Nov 26, 2019

Conversation

shilman
Copy link
Member

@shilman shilman commented Nov 23, 2019

Issue: #7811

What I did

Support export default { title, component, subcomponents } in addition to export default { title, component, parameters: { subcomponents }} to match the documentation. Also added a test case.

@vercel
Copy link

vercel bot commented Nov 23, 2019

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/storybook/monorepo/32ogjdcb9
🌍 Preview: https://monorepo-git-7811-toplevel-subcomponents.storybook.now.sh

@shilman shilman added the csf label Nov 23, 2019
@shilman shilman added this to the 5.3.0 milestone Nov 23, 2019
Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

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

WFM

@shilman shilman merged commit d89267d into next Nov 26, 2019
@shilman shilman deleted the 7811-toplevel-subcomponents branch November 26, 2019 05:23
@adeelibr
Copy link

is this still only available in beta version? 😄 @shilman
P.S: thank you for adding this wonderful feature. :)

@shilman
Copy link
Member Author

shilman commented Dec 21, 2019

@adeelibr 5.3 is in RC now, with full release targeted for early Jan

@aareman
Copy link

aareman commented Dec 23, 2019

This doesn't work for me.
"@storybook/react": "^5.3.0-rc.0",

export default {
    title: 'Demos|Layouts',
    component: Container,
    subcomponents: { Tabs, Tab },
};

I tried this as well

export default {
    title: 'Demos|Layouts',
    component: Container,
    subcomponents: [ Tabs, Tab ],
};

@adeelibr
Copy link

Works at my end. @aareman

@aareman
Copy link

aareman commented Dec 23, 2019

@adeelibr silly me. I had the beta for storybook not the docs. :) let that be a lesson to the next guy like me.

Thank you. Really awesome stuff!

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.

4 participants