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

[React / typescript] Empty type definitions and description #13490

Closed
shikitsun opened this issue Dec 20, 2020 · 1 comment
Closed

[React / typescript] Empty type definitions and description #13490

shikitsun opened this issue Dec 20, 2020 · 1 comment

Comments

@shikitsun
Copy link

Describe the bug
Empty types and description in docs page

To Reproduce
Steps to reproduce the behavior:

  1. Declare arrow Component (with interface or type to define the types also)
  2. Export component through export default Component syntax
  3. Import Component as import Component from '...'
  4. Declare some base template
  5. Run storybook
  6. Click on 'docs' tab
  7. See no description and no types definitions

Expected behavior
Description for Component and type definitions

Screenshots

image
image

Main.js config

module.exports = {
  typescript: {
    check: false,
    checkOptions: {},
    reactDocgen: "react-docgen-typescript",
    reactDocgenTypescriptOptions: {
      shouldExtractLiteralValuesFromEnum: true,
      propFilter: (prop) =>
        prop.parent ? !/node_modules/.test(prop.parent.fileName) : true,
    },
  },
  stories: ["../src/stories/**/*.stories.(ts|tsx|js|jsx|mdx)"],
  addons: [
    "@storybook/addon-actions",
    "@storybook/addon-links",
    "@storybook/preset-create-react-app",
    {
      name: "@storybook/addon-docs",
      options: {
        configureJSX: true,
      },
    },
  ],
};

System

System:
    OS: Linux 4.19 Ubuntu 20.04 LTS (Focal Fossa)
    CPU: (8) x64 Intel(R) Core(TM) i5-8300H CPU @ 2.30GHz
Binaries:
    Node: 12.18.2 - /usr/local/bin/node
    npm: 6.14.8 - /usr/local/bin/npm
npmPackages:
    @storybook/addon-actions: ^6.1.11 => 6.1.11 
    @storybook/addon-docs: ^6.1.11 => 6.1.11 
    @storybook/addon-links: ^6.1.11 => 6.1.11 
    @storybook/node-logger: ^6.1.11 => 6.1.11 
    @storybook/preset-create-react-app: ^3.1.5 => 3.1.5 
    @storybook/react: ^6.1.11 => 6.1.11

Additional context
How to fix: use export {Component} instead of export default Component and import {Component} from '...' instead import Component from '...' also

@shilman
Copy link
Member

shilman commented Dec 21, 2020

closing as duplicate to #9556

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

2 participants