addon-docs: No props for component in node_modules
See original GitHub issueDescribe the bug
I’ve created a mono repo which holds a component package and a cra+stroybook+ts project. The storybook project installs and imports the component package in its stories, but docs does not show the props of the component.
- component package correctly builds dist and types
- if I create a component inside the storybook project, it shows the props
Screenshots
set component
to Component from my pacakge
set component
to Component inside the storybook project
System:
"typescript": "^4.0.2",
"@storybook/react": "^6.0.16",
"@storybook/preset-create-react-app": "^3.1.4",
"@storybook/addon-actions": "^6.0.16",
"@storybook/addon-links": "^6.0.15",
"@storybook/addon-essentials": "^6.0.16",
"@storybook/addons": "^6.0.16",
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:11 (3 by maintainers)
Top Results From Across the Web
StoryBook addon-docs: "No props found for this component ...
I was able to solve this issue, basically I had misconfigured the webpack.config.js for StoryBook,
Read more >DocsPage - Storybook - JS.ORG
Component parameter. Storybook uses the component key in the story file's default export to extract the component's description and props.
Read more >@component-controls/storybook - npm
Start using @component-controls/storybook in your project by running `npm i @component-controls/storybook`. There are no other projects in ...
Read more >Storybook Docs with mdx support and addon knobs - Medium
We have used Storybook to document our React component library for a while, ... name: '@storybook/addon-docs', // new addon for docs
Read more >No props appearing for named function export with Addon ...
... various things to get the props to appear for my component library with no luck. This is using the 5.3.0-rc.0 version of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@shilman @zhaoyao91
It’s work for me as an alternative solution:
and
I was in a similar situation to @sehv where I was trying to pass components from a package to
<ArgsTable of={Component} />
(without Typescript just pure JS + PropTypes), and it still wasn’t working.The solution above got me half the way there. Storybooks webpack config seems to
exclude: /node_modules/
by default so what worked for me was to modify the exclude:NOTE: It’s important for it to still ignore
node_modules
for everything else otherwise the build will grind to a halt.