Display of Template inside Story not as expected
See original GitHub issueDescribe the bug To Reproduce
I have the following code inside a mdx file:
export const Template = (args) => <Button {...args} />;
<Preview>
<Story
name="Interactive"
args={{ label: "Primary button ", state: "primary" }}
>
{Template.bind()}
</Story>
</Preview>
When I view the relevant Docs page in the browser and click on the “Show code” link, the following is shown:
<MDXCreateElement
buttonType="button"
label="Primary button "
mdxType="Button"
originalType={() => {}}
state="primary"
/>
Expected behavior
I expected it to output the following:
<Button label="Primary button" state="primary" />
Screenshots

System:
Environment Info:
System:
OS: macOS 10.15.5
CPU: (8) x64 Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz
Binaries:
Node: 14.5.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.5 - /usr/local/bin/npm
Browsers:
Firefox: 78.0.2
Safari: 13.1.1
npmPackages:
@storybook/preset-create-react-app: ^3.1.4 => 3.1.4
@storybook/react: ^6.0.0-rc.26 => 6.0.0-rc.26
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Count method in Django template not working as expected
I tried using the count method but, it retrieved the total number of comments in my comments table instead of the number of...
Read more >The Content Template element - HTML - MDN Web Docs
firstClone is a DocumentFragment instance, so while it gets appended inside the container as expected, clicking on it does not trigger the click ......
Read more >User Story Templates, Examples, & Formulas for ... - AHA.io
Simple user story template. This starter template will help you write user stories and acceptance criteria and organize them in one easy-to-read view....
Read more >User Story Template Advantages - Mountain Goat Software
In my user stories book and in all my training and conference sessions on user stories, I advocate writing user stories in a...
Read more >Development guide for GitLab CI/CD templates
If the template is intended for copy-paste usage only, it might be possible to ... Users may want to use an older stable...
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 Free
Top 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

Looks similar to https://github.com/storybookjs/storybook/issues/11542
I’m guessing this a bug or maybe the doc for controls is not updated, but you can do this as a workaround and it should output the code correctly:
closing as dupe to #11542