-
-
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: Unwanted props appearing on the generated docs props. #8781
Comments
You can fix this by specifying a https://github.com/strothj/react-docgen-typescript-loader#loader-options We should be able to excluded indirect props by default before the end of the beta. |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
1 similar comment
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook! |
please reopen :) Any updates on the quoted statement? |
Jiminy cricket!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-alpha.39 containing PR #10464 that references this issue. Upgrade today to try it out! You can find this prerelease on the Closing this issue. Please re-open if you think there's still more to do. |
The above PR doesn't exactly solve this issue, but it adds a lot more flexibility and a workaround using the |
Hi @patricklafrance and @shilman I just want to know that the issue regarding indirect props is fixed or not? I am also facing similar problem. I am using Storybook 5.3.19 |
I'm in the process of updating to StoryBook 6 and there seem to be no need for my workaround anymore: config.module.rules.push({
test: /\.(ts|tsx)$/,
use: [
{
loader: require.resolve('react-docgen-typescript-loader'),
options: {
// Do not show additional props from styled-components, React, etc in the Props table
// Waiting to be handled automatically by Storybook: https://github.com/storybookjs/storybook/issues/8781
propFilter: (propInfo) =>
propInfo && propInfo.parent && !propInfo.parent.fileName.includes('/node_modules/'),
},
},
],
}); But now I don't see any of the props of my component, and instead see some of the props from styled-components: |
Thanks @trumbitta . There are a few different ways to disable rows in the
I know we're a bit all over the place here. Sorry for the confusion. |
@shilman Thank you for the hints! The |
Fixed by include/exclude above, available as both parameters and props in 7.0 https://storybook.js.org/docs/react/api/doc-block-argtypes |
When viewing props from jsx using
styled-components
the props table will contain all props passed what seems to bestyled-components
Example:
Also, for some reason, my docs page is not centered
Expected behavior
Only direct component props will be shown.
Docs are centered
My config:
My Presets:
Will provide more context if needed. would love to know the solution to thesetwo problems :)
The text was updated successfully, but these errors were encountered: