-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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: Fix subcomponents display logic #11415
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the logic is NQR
addons/docs/src/blocks/Props.tsx
Outdated
if (!story || showComponent) { | ||
allComponents = { [mainLabel]: main }; | ||
} | ||
allComponents = { ...allComponents, ...subcomponents }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't we just check that allComponents
is falsy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated w/ slightly cleaner code. logic is same AFAIK because spreading falsey is allowed
Issue: #10958
What I did
This change simplifies the
Props
display logic. Now:component
is shown if:showComponent
propHow to test
See
props.stories.mdx
inofficial-storybook