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

ArgsTable doesn't show Children #17698

Closed
Bowriverstudio opened this issue Mar 12, 2022 · 2 comments
Closed

ArgsTable doesn't show Children #17698

Bowriverstudio opened this issue Mar 12, 2022 · 2 comments

Comments

@Bowriverstudio
Copy link

Describe the bug

import React, { FC } from "react";

type Props = {
  title?: string;
};

const TestComp: FC<Props> = ({ title="Hello", children }) => {
return (
    <>
      {title}
      {children}
    </>
  );
}

In my story file.

<ArgsTable of={TestComp} />

Which Results in:
Screen Shot 2022-03-12 at 8 26 21 AM

I expect to see the Children

System
Environment Info:

System:
OS: macOS 11.2.3
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Binaries:
Node: 14.17.6 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 8.1.1 - /usr/local/bin/npm
Browsers:
Chrome: 99.0.4844.51
Edge: 99.0.1150.39
Safari: 14.0.3
npmPackages:
@storybook/addon-a11y: ^6.4.19 => 6.4.19
@storybook/addon-console: ^1.2.3 => 1.2.3
@storybook/addon-docs: ^6.4.19 => 6.4.19
@storybook/addon-essentials: ^6.4.19 => 6.4.19
@storybook/builder-webpack5: ^6.4.19 => 6.4.19
@storybook/manager-webpack5: ^6.4.19 => 6.4.19
@storybook/react: ^6.4.19 => 6.4.19

@shilman
Copy link
Member

shilman commented Jun 8, 2023

We’re cleaning house! Storybook has changed a lot since this issue was created and we don’t know if it’s still valid. Please open a new issue referencing this one if:

@shilman shilman closed this as not planned Won't fix, can't repro, duplicate, stale Jun 8, 2023
@developerdanwu
Copy link

developerdanwu commented Dec 5, 2023

If anyone comes across I added skipChildrenPropWithoutDoc: false to my config object in .storybook/main.ts and all the children props came back. Seems you only need to specify this if you use the old ArgsTable. The new Controls table in storybook 7 is fine.

const config: StorybookConfig = {
  typescript: {
    reactDocgen: 'react-docgen-typescript',
    reactDocgenTypescriptOptions: {
      skipChildrenPropWithoutDoc: false,
      tsconfigPath: './tsconfig.json',
      propFilter: (prop) => {
        if (prop.name === 'children') {
          return true;
        }

        if (prop.parent) {
          return (
            !/@types\/react/.test(prop.parent.fileName) &&
            !/@emotion/.test(prop.parent.fileName)
          );
        }
        return true;
      },
    },
  },
  stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
   ...
};

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

3 participants