You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe
I would like to define my stories in tsx files for type safety and reference those stories in mdx. I can do this with the id attribute of <Story /> like so: <Story id="badge-badge--icons" />. However, <ArgsTable /> cannot reference a story by id in the same way. The <ArgsTable story="Icons" /> example only seems to work with stories named in the mdx file. If I try <ArgsTable story="badge-badge--icons" />, I see this error: Invalid name '', must include alphanumeric characters.
This would allow all stories and argTypes to be defined in TypeScript and referenced in the mdx documentation.
Describe alternatives you've considered
If I use the same title in the mdx <Meta /> and tsx meta, I can use <ArgsTable story={PRIMARY_STORY} /> and it works, but there is a duplicate title warning in the console: Duplicate title: 'Badge'. That led me to separating the mdx from the tsx with different names, <Meta title="Badge/Overview" component={Badge} /> and title: 'Badge/Badge' respectively. I can no longer get ArgsTable to work with the separate names though.
<ArgsTable of={Badge} /> does not use the argTypes customizations defined in the tsx file and it also doesn't allow the story to be changed with controls in the args table.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe
I would like to define my stories in tsx files for type safety and reference those stories in mdx. I can do this with the
id
attribute of<Story />
like so:<Story id="badge-badge--icons" />
. However,<ArgsTable />
cannot reference a story by id in the same way. The<ArgsTable story="Icons" />
example only seems to work with stories named in the mdx file. If I try<ArgsTable story="badge-badge--icons" />
, I see this error:Invalid name '', must include alphanumeric characters
.Describe the solution you'd like
This would allow all stories and
argTypes
to be defined in TypeScript and referenced in the mdx documentation.Describe alternatives you've considered
If I use the same title in the mdx
<Meta />
and tsxmeta
, I can use<ArgsTable story={PRIMARY_STORY} />
and it works, but there is a duplicate title warning in the console:Duplicate title: 'Badge'
. That led me to separating the mdx from the tsx with different names,<Meta title="Badge/Overview" component={Badge} />
andtitle: 'Badge/Badge'
respectively. I can no longer getArgsTable
to work with the separate names though.<ArgsTable of={Badge} />
does not use theargTypes
customizations defined in the tsx file and it also doesn't allow the story to be changed with controls in the args table.The text was updated successfully, but these errors were encountered: