Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSF3: Can't reuse stories in DocsContainer #15510

Closed
frassinier opened this issue Jul 7, 2021 · 1 comment
Closed

CSF3: Can't reuse stories in DocsContainer #15510

frassinier opened this issue Jul 7, 2021 · 1 comment

Comments

@frassinier
Copy link
Contributor

frassinier commented Jul 7, 2021

Is your feature request related to a problem? Please describe
I've switched stories for using CSF 3.0
I'm struggling while reusing stories from an external file with the addon-docs

I have a first file describing stories using CSF3

export const Default = {
	href: '#',
	children: 'Link example',
};

And I would like to reuse them that way:

import { ArgsTable, Meta, Canvas, Story } from '@storybook/addon-docs';

import Link from '../';
import * as Stories from '../Link.stories';

<Meta title="Components/Link" component={Link} />

<Canvas>
	<Story
		story={Stories.Default}
		args={{
			children: 'Help',
			href: 'https://help.talend.com',
			disabled: false,
			hideExternalIcon: false,
		}}
		argTypes={{
			href: {
				description: 'Link reference',
				control: {
					type: 'text',
				},
			},
		}}
	/>
</Canvas>

<ArgsTable story="usage" />

Describe the solution you'd like
Be able to don't have to maintain the template while using MDX

Describe alternatives you've considered
I can still define a template

import { ArgsTable, Meta, Canvas, Story } from '@storybook/addon-docs';

import Link from '../';
import * as Stories from '../Link.stories';

<Meta title="Components/Link" component={Link} />

<Canvas>
	<Story
		name="usage"
		args={{
			children: 'Help',
			href: 'https://help.talend.com',
			disabled: false,
		}}
		argTypes={{
			href: {
				description: 'Link reference',
				control: {
					type: 'text',
				},
			},
		}}
	>
		{props => <Link {...props} />}
	</Story>
</Canvas>

<ArgsTable story="usage" />

Are you able to assist to bring the feature to reality?
yes, sure

Additional context

@shilman
Copy link
Member

shilman commented Jul 13, 2021

Shiver me timbers!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.4.0-alpha.15 containing PR #15533 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb upgrade --prerelease

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants