No props appearing for named function export with Addon-docs
See original GitHub issueDescribe the bug
Been trying various things to get the props to appear for my component library with no luck. This is using the 5.3.0-rc.0
version of Storybook and Addon-docs.
I’ve been trying with both js
and mdx
file types and seeing no success. A named function export, with props and comments, renders in the Docs file with “No props found for this component”.
I’ve set up the MDX rules following the Manual configuration guide on the README.
Expected behavior Props should be populated in Docs.
Code snippets Component:
import React from 'react'
import PropTypes from 'prop-types'
export const Dummy = ({
textProp
}) => {
return (
<div>
{ textProp }
</div>
)
}
Dummy.propTypes = {
/**
* Test code export
*/
textProp: PropTypes.string.isRequired,
}
MDX:
import { Meta, Props, Preview, Story } from '@storybook/addon-docs/blocks'
import { Dummy } from './'
<Meta
title="mdx/dummy"
component={Dummy}
/>
# Test
<Preview>
<Story name="testing">
<Dummy textProp="Hello world" />
</Story>
</Preview>
## Props
<Props of={Dummy} />
Screenshots
System:
System:
OS: macOS 10.15.1
CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
Binaries:
Node: 11.13.0 - ~/.nvm/versions/node/v11.13.0/bin/node
Yarn: 1.21.1 - ~/.yarn/bin/yarn
npm: 6.7.0 - ~/.nvm/versions/node/v11.13.0/bin/npm
Browsers:
Chrome: 79.0.3945.88
Safari: 13.0.3
npmPackages:
@storybook/addon-a11y: ^5.3.0-rc.0 => 5.3.0-rc.0
@storybook/addon-contexts: ^5.3.0-rc.0 => 5.3.0-rc.0
@storybook/addon-docs: ^5.3.0-rc.0 => 5.3.0-rc.0
@storybook/addon-knobs: ^5.3.0-rc.0 => 5.3.0-rc.0
@storybook/addon-links: ^5.3.0-rc.0 => 5.3.0-rc.0
@storybook/addon-viewport: ^5.3.0-rc.0 => 5.3.0-rc.0
@storybook/addons: ^5.3.0-rc.0 => 5.3.0-rc.0
@storybook/preset-scss: ^1.0.2 => 1.0.2
@storybook/react: ^5.3.0-rc.0 => 5.3.0-rc.0
@storybook/theming: ^5.3.0-rc.0 => 5.3.0-rc.0
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:46 (11 by maintainers)
Top Results From Across the Web
No props appearing for named function export with Addon ...
I've set up the MDX rules following the Manual configuration guide on the README. Expected behavior Props should be populated in Docs. Code...
Read more >StoryBook addon-docs: "No props found for this component ...
I was able to solve this issue, basically I had misconfigured the webpack.config.js for StoryBook,
Read more >Docs Addon | Storybook: Frontend workshop for UI development
module.exports = { addons: [ { name: '@storybook/addon-docs ...
Read more >Documenting design systems with Storybook Docs
named export — functions that describe the stories ... import { Canvas, Meta, Story } from '@storybook/addon-docs/blocks' ...
Read more >Storybook Docs with mdx support and addon knobs - Medium
name : '@storybook/addon-docs', // new addon for docs ... as well as showing the props accepted and a copy and paste version of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try doing this, got out of the same problem.
@getignited Hey, Have you tried
import * as React from 'react'
in your component?