Primary slot description using JsDoc comment not working
See original GitHub issueDescribe the bug I have a JsDoc comment in my component source file, just above the line export default but it doesn’t reflect in DocsPage generated for my component. Its my first time trying this feature so I am not sure if this is actually a bug or something I might be doing wrong
To Reproduce I have a source component file that looks like this
/**
* Controlled stateless component for a circular checkbox with a click event handler prop.
*/
export default class CheckboxCircular extends React.Component<ICheckboxCircularProps> { ...`
Expected behavior But right now description only gets populated in the generated DocsPage when I try this in my story file
export default {
title: 'Circular Checkbox',
component: CheckboxCircular,
decorators: [cardDecorator, withKnobs],
parameters: {
componentSubtitle: "Controlled component",
docs: {
extractComponentDescription: () => "Controlled stateless component for a circular checkbox with a click event handler prop."
}
}
}
I want it to work out of the box since I don’t want to use this workaround everywhere. I am onboarding a big ux repo to storybook with lots of components
Screenshots It should look like this in the doc page of this component
But without ‘extractComponentDescription’ it looks like
System: System: OS: Windows 10 10.0.18363 CPU: (4) x64 Intel® Core™ i7-7600U CPU @ 2.80GHz Binaries: Node: 12.18.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.4 - ~\AppData\Roaming\npm\yarn.CMD npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: 44.18362.449.0 npmPackages: @storybook/addon-actions: ^5.3.19 => 5.3.19 @storybook/addon-docs: ^5.3.19 => 5.3.19 @storybook/addon-knobs: ^5.3.19 => 5.3.19 @storybook/addon-links: ^5.3.19 => 5.3.19 @storybook/addon-storysource: ^5.3.19 => 5.3.19 @storybook/addons: ^5.3.19 => 5.3.19 @storybook/react: ^5.3.19 => 5.3.19
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (6 by maintainers)
Top GitHub Comments
@hardikjain0309 glad you got it working! FYI, the installation instructions are here:
https://github.com/storybookjs/storybook/blob/next/addons/docs/README.md#installation
Specifically:
When you don’t add
/register
to the end, it uses the preset, which pre-configures a lot of stuff for you.Here’s another variant of that a little bit lower in the same file:
A few lines lower:
And so on…
after my investigation. the easist way is to add additional
named export
, because react-docgen-typescript only supportnamed export
before
change to