question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[addon-docs] prop descriptions not extracted for default exports

See original GitHub issue

I noticed that docgen is not able to extract any prop descriptions for default exports, why is that? Where this limitation comes from? It is a huge shortcoming for any containers (which I think constitute majority of components in any react app), since they are usually exported as defaults.

Should we export them separately from the module, or what’s the recommended approach to deal with that?

Environment Info:

  System:
    OS: macOS 10.15.5
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Binaries:
    Node: 10.20.1 - ~/.nvm/versions/node/v10.20.1/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.4 - ~/.nvm/versions/node/v10.20.1/bin/npm
  Browsers:
    Chrome: 83.0.4103.116
    Safari: 13.1.1
  npmPackages:
    @storybook/addon-actions: ^6.0.0-beta.37 => 6.0.0-beta.37 
    @storybook/addon-controls: ^6.0.0-beta.37 => 6.0.0-beta.37 
    @storybook/addon-docs: ^6.0.0-beta.37 => 6.0.0-beta.37 
    @storybook/addon-knobs: ^6.0.0-beta.37 => 6.0.0-beta.37 
    @storybook/addon-links: ^6.0.0-beta.37 => 6.0.0-beta.37 
    @storybook/addons: ^6.0.0-beta.37 => 6.0.0-beta.37 
    @storybook/preset-create-react-app: ^2.1.2 => 2.1.2 
    @storybook/react: ^6.0.0-beta.37 => 6.0.0-beta.37 
    @storybook/theming: ^6.0.0-beta.37 => 6.0.0-beta.37 

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
jayarjocommented, Jun 30, 2020

We are using typescript types and they aren’t picked up from default exports.

1reaction
shilmancommented, Aug 10, 2020

Please upgrade preset-create-react-app to the latest: npx sb@next upgrade --prerelease

Read more comments on GitHub >

github_iconTop Results From Across the Web

@storybook/addon-docs - npm
Start using @storybook/addon-docs in your project by running `npm i ... text descriptions, docgen comments, props tables, and code examples ...
Read more >
Storybook Docs with mdx support and addon knobs - Medium
The “Default” in export const Default is what you have your component titled as in the side nav. You can have multiple versions...
Read more >
How do I render an MD file for a custom Storybook addon?
... that if I pulled import { Description } from "@storybook/components"; instead of @storybook/addon-docs , everything worked as expected.
Read more >
export - JavaScript - MDN Web Docs
Description. Every module can have two different types of export, named export and default export. You can have multiple named exports per ...
Read more >
@storybook/addon-docs | Yarn - Package Manager
@storybook/addon-docs ... Document component usage and properties in Markdown ... Merge all PRs into next , which is the default branch.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found