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: Support JSDoc @ignore tag to remove a prop from the props table

See original GitHub issue

Is your feature request related to a problem? Please describe. My component contains props that the consumer shouldn’t be bothered with. I would like those props to be ignored by the props table.

Describe the solution you’d like JSDoc already support the @ignore tag. The props table could also use this tag to ignore the props.

Usage:

static propTypes = {
   /**
    * @ignore
    */
   reactDatesCalendar: node
};

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
shilmancommented, Jun 1, 2020

@eybbus In SB6-beta, you can use the propFilter option of react-docgen-typescript-loader

See: https://github.com/storybookjs/storybook/blob/next/docs/src/pages/configurations/typescript-config/index.md#mainjs-configuration

https://github.com/strothj/react-docgen-typescript-loader#loader-options

As a hack, you can also use the include prop of the Props block to create a whitelist for that particular component.

1reaction
georgewildecommented, May 29, 2020

@eybbus I had the same question and @shamin your response was spot-on, so thanks for that. Just in case anyone else is wondering what that actually looks like when you add the propFilter here is the end result from my main.ts file:

config.module.rules.push({
    test: /\.(ts|tsx)$/,
    use: [
        {
            loader: require.resolve('babel-loader'),
            options: {
                presets: [
                    '@babel/preset-react',
                    '@babel/preset-typescript',
                ],
            },
        },
        {
            loader: require.resolve('react-docgen-typescript-loader'),
            options: {
            propFilter: prop =>
                prop.parent
                    ? !/node_modules/.test(prop.parent.fileName)
                    : true,
            },
        },
    ],
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

ArgsTable - Storybook - JS.ORG
ArgsTable. Storybook Docs automatically generates component args tables for components in supported frameworks. These tables list the arguments (args for short) ...
Read more >
storybook/addon-docs - npm
DocsPage is a zero-config aggregation of your component stories, text descriptions, docgen comments, props tables, and code examples into clean, ...
Read more >
@types/storybook__addon-knobs | Yarn - Package Manager
Angular: set the @ViewChild with a non-empty value in StorybookWrapperComponent (#14586); Addon-docs: Fix ArgsTable sorting when using of={Component} ...
Read more >
Issue with Storybook autogenerating docs/prop description for ...
I had exact same issue. The problem is in version you use. Downgrading Storybook to v 6.3.0 solved the issue in my case....
Read more >
https://raw.githubusercontent.com/storybooks/story...
Bug Fixes - Revert "Addon-docs/Angular: Fix inline rendering setup" ... alpha prerelease: - Vue 3: Map args with setup hook & remove automatic...
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