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, propTypes show up as other #2198

Closed
TimGraf opened this issue Oct 31, 2017 · 5 comments
Closed

Info addon, propTypes show up as other #2198

TimGraf opened this issue Oct 31, 2017 · 5 comments

Comments

@TimGraf
Copy link

TimGraf commented Oct 31, 2017

We are using the info addon for storybook and the propType in the Prop Types table always show up as "other". The required attribute seems to work correctly.

We are using the following versions.

"dependencies": {
   ...
   "prop-types": "15.5.10",
   ...

"devDependencies": {
   "@storybook/addon-info": "^3.2.13",
   "@storybook/react": "^3.2.13",
   ...

This issue is similar to a previously reported issue.
storybook-eol/react-storybook-addon-info#145

@danielduan
Copy link
Member

danielduan commented Oct 31, 2017

This is a known bug for a while. If you have some time to dig into why it's happening, we'd really appreciate it.

related: #1723 #1661

@TimGraf
Copy link
Author

TimGraf commented Nov 1, 2017

@danielduan So I forked the repo and looked at the info addon and noticed in the example storybook for the info addon the propTypes were displaying as expected. So the bug had to be in our code. I then looked more closely at our code and found the issue.

We were exporting our component as follows.

export const DataTable = ({
...
// we define the component and set prop types
...
export default DataTable

I removed the first export and we now have prop types displaying as expected with the info addon.

const DataTable = ({
...
// we define the component and set prop types
...
export default DataTable

I can close this issue if you'd like.

@danielduan
Copy link
Member

thanks for reporting back! I think the propType detection support for named exports is definitely a bit shaky.

@adamgen
Copy link

adamgen commented Dec 14, 2019

It still happens, was it fixed or is it the same issue since?

@shilman
Copy link
Member

shilman commented Dec 14, 2019

Addon-info is being superceded by addon-docs, which fixes a bunch of bugs and is easier to maintain. Please give it a try! https://medium.com/storybookjs/storybook-docspage-e185bc3622bf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants