[addon-docs] mdx breaks with expressions as Story name
See original GitHub issueDescribe the bug
When using a Story in mdx, if you use brackets around your text variable like below, then the compiler errors out.
<Preview>
<Story name={'text'}>
<Button onClick={action('clicked')}>Hello Button</Button>
</Story>
</Preview>
To Reproduce
Create MDX file with brackets around the Story name text
Expected behavior
Storybook should compile
possible cause
Error message points to this
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
MDX - Storybook
MDX -defined stories are identical to regular Storybook stories, so they can be used with Storybook's entire ecosystem of addons and view layers....
Read more >storybook/addon-docs - npm
MDX is a syntax for writing long-form documentation and stories side-by-side in the same file. In contrast to DocsPage , which provides smart ......
Read more >Storybook Docs with mdx support and addon knobs - Medium
name : '@storybook/addon-docs', // new addon for docs ... If embedding the story directly into a mdx file, the source won't show when ......
Read more >Disable canvas per story in storybook 6 - Stack Overflow
I don't know if this solution will fit your needs, but the workaroud I found was to write my stories in .mdx and...
Read more >@storybook/addon-docs | Yarn - Package Manager
how to introduce significant new features (e.g. vue support, story hierarchy)?; how to converge on key design decisions (e.g. new addons API)?; how...
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
The use case is that we would like to be able to keep our linter consistent across all jsx. We have the lint rule for everything being wrapped in curly brackets.
But besides that use case, using curly brackets in jsx is expected and valid behavior. It feels like a bug that this is breaking. I’m not sure if i just missed some important note in the docs pointing out the different behavior though. But i am a little concerned that when someone else in the team goes to make a doc that they keep the same style of jsx we use everywhere else, get this bug, and then not know why its not compiling
Hey there, it’s me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!