[addon-docs] Why Props component doesn't work?
See original GitHub issueIn index.stories.mdx
:
import { Meta, Preview, Story, Props } from '@storybook/addon-docs/blocks';
import { HomePanel } from '@/index';
<Meta title='Mdx|Home|Panel' component={HomePanel} />
# HomePanel
With `MDX` we can define a story for `HomePanel` right in the middle of our
markdown documentation.
<Preview>
<Story name='Panel'>
<HomePanel title="abc" amount="1000" description="123" />
</Story>
</Preview>
## Props
<Props of={HomePanel} />
In HomePanel.tsx
:
import React, { ReactNode, FC } from 'react'
interface HomePanelProps {
title: string | ReactNode
amount: string | ReactNode
description: string | ReactNode
style?: Object
}
const HomeCreditPanel: FC<HomePanelProps> = ({ title, amount, description, style }) => {
return (
<div className="panel" style={style}>
<div className='title'>
{ title }
</div>
<div className='amount'>
{amount}
</div>
<div className='description'>
{description}
</div>
</div>
)
}
export default HomePanel
But the docs shows:
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Docs Addon | Storybook: Frontend workshop for UI development
DocsPage is a zero-config aggregation of your component stories, text descriptions, docgen comments, props tables, and code examples into clean, readable pages.
Read more >Issue with Storybook autogenerating docs/prop description for ...
I added storybook to the repo and modified a few of the webpack rules for my .scss files to load properly. I can...
Read more >Compare DocsPage and MDX syntax in Storybook with example
DocsPage · MDX · Unlocking Storybook's superpower... using MDX this time · Example: Card Component · Working with props using args and argTypes...
Read more >React Top-Level API
If you load React from a <script> tag, these top-level APIs are available on the React ... Component doesn't implement shouldComponentUpdate() , but...
Read more >Docs • Svelte
With this, npm run build will generate HTML, JS and CSS files inside the ... It will be used if the component's consumer...
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
It works when I add ‘export’:
I just saw it in react-docgen-typescript-loader
However, I am still unable to understand why…
Are you able to showcase prop descriptions ? Mind sharing your presets and config