diff --git a/docs/faq.md b/docs/faq.md index 4dd9e124450f..b459660a03e7 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -426,7 +426,7 @@ We're aware that the default Typescript story construct might seem outdated and // Button.stories.ts | tsx import React from 'react'; -import { ComponentStory, ComponentMeta } from '@storybook/react'; +import type { ComponentStory, ComponentMeta } from '@storybook/react'; const StoryMeta: ComponentMeta = { /* πŸ‘‡ The title prop is optional. diff --git a/docs/snippets/react/app-story-with-mock.ts.mdx b/docs/snippets/react/app-story-with-mock.ts.mdx index 1613c6f8a3e9..61e01fd388bc 100644 --- a/docs/snippets/react/app-story-with-mock.ts.mdx +++ b/docs/snippets/react/app-story-with-mock.ts.mdx @@ -3,7 +3,7 @@ import React from 'react'; -import { ComponentStory, ComponentMeta } from '@storybook/react'; +import type { ComponentStoryFn, ComponentMeta } from '@storybook/react'; import App from './App'; @@ -16,7 +16,7 @@ export default { component: App, } as ComponentMeta; -const Template: ComponentStory = () => ; +const Template: ComponentStoryFn = () => ; export const Success = Template.bind({}); Success.parameters = { diff --git a/docs/snippets/react/button-group-story.ts.mdx b/docs/snippets/react/button-group-story.ts.mdx index 8b25518eb4a9..24c24e512a40 100644 --- a/docs/snippets/react/button-group-story.ts.mdx +++ b/docs/snippets/react/button-group-story.ts.mdx @@ -3,7 +3,7 @@ import React from 'react'; -import { ComponentStory, ComponentMeta } from '@storybook/react'; +import type { ComponentStoryFn, ComponentMeta } from '@storybook/react'; import { ButtonGroup } from '../ButtonGroup'; @@ -19,7 +19,7 @@ export default { component: ButtonGroup, } as ComponentMeta; -const Template: ComponentStory = (args) => ; +const Template: ComponentStoryFn = (args) => ; export const Pair = Template.bind({}); Pair.args = { diff --git a/docs/snippets/react/button-story-click-handler.ts.mdx b/docs/snippets/react/button-story-click-handler.ts.mdx index 89909a04e4ff..febf5a55461c 100644 --- a/docs/snippets/react/button-story-click-handler.ts.mdx +++ b/docs/snippets/react/button-story-click-handler.ts.mdx @@ -3,7 +3,7 @@ import React from 'react'; -import { ComponentStory, ComponentMeta } from '@storybook/react'; +import type { ComponentStoryFn, ComponentMeta } from '@storybook/react'; import { action } from '@storybook/addon-actions'; @@ -18,5 +18,5 @@ export default { component: Button, } as ComponentMeta; -export const Basic: ComponentStory = () => ; +const Basic: ComponentStoryFn = () => ; ``` \ No newline at end of file diff --git a/docs/snippets/react/button-story-with-args.ts.mdx b/docs/snippets/react/button-story-with-args.ts.mdx index 76b502fa348d..0d42716af396 100644 --- a/docs/snippets/react/button-story-with-args.ts.mdx +++ b/docs/snippets/react/button-story-with-args.ts.mdx @@ -3,7 +3,7 @@ import React from 'react'; -import { ComponentStory, ComponentMeta } from '@storybook/react'; +import type { ComponentStoryFn, ComponentMeta } from '@storybook/react'; import { Button, ButtonProps } from './Button'; @@ -17,7 +17,7 @@ export default { } as ComponentMeta; //πŸ‘‡ We create a β€œtemplate” of how args map to rendering -const Template: ComponentStory = (args) => ; +export const Primary: ComponentStoryFn = () => ; ``` \ No newline at end of file diff --git a/docs/snippets/react/checkbox-story-csf.ts.mdx b/docs/snippets/react/checkbox-story-csf.ts.mdx index 503a2f991320..7ee4746026e6 100644 --- a/docs/snippets/react/checkbox-story-csf.ts.mdx +++ b/docs/snippets/react/checkbox-story-csf.ts.mdx @@ -3,7 +3,7 @@ import React from 'react'; -import { ComponentMeta, ComponentStory } from '@storybook/react'; +import { ComponentMeta, ComponentStoryFn } from '@storybook/react'; import { Checkbox } from './Checkbox'; @@ -16,7 +16,7 @@ export default { component: Checkbox, } as ComponentMeta; -export const allCheckboxes: ComponentStory = () => ( +export const allCheckboxes: ComponentStoryFn = () => (
diff --git a/docs/snippets/react/component-story-custom-args-complex.ts.mdx b/docs/snippets/react/component-story-custom-args-complex.ts.mdx index be64e1f14af5..2b21fdd2335f 100644 --- a/docs/snippets/react/component-story-custom-args-complex.ts.mdx +++ b/docs/snippets/react/component-story-custom-args-complex.ts.mdx @@ -3,7 +3,7 @@ import React from 'react'; -import { ComponentStory, ComponentMeta } from '@storybook/react'; +import type { ComponentStoryFn, ComponentMeta } from '@storybook/react'; import { YourComponent } from './your-component'; @@ -30,7 +30,7 @@ export default { }, } as ComponentMeta; -const Template: ComponentStory = ({ propertyA, propertyB, ...rest }) => { +const Template: ComponentStoryFn = ({ propertyA, propertyB, ...rest }) => { //πŸ‘‡ Assigns the result from the function to a variable const someFunctionResult = someFunction(propertyA, propertyB); diff --git a/docs/snippets/react/component-story-figma-integration.ts.mdx b/docs/snippets/react/component-story-figma-integration.ts.mdx index 1b54ea82e143..9d350e571fef 100644 --- a/docs/snippets/react/component-story-figma-integration.ts.mdx +++ b/docs/snippets/react/component-story-figma-integration.ts.mdx @@ -3,7 +3,7 @@ import React from 'react'; -import { ComponentStory, ComponentMeta } from '@storybook/react'; +import type { ComponentStoryFn, ComponentMeta } from '@storybook/react'; import { withDesign } from 'storybook-addon-designs'; @@ -17,7 +17,7 @@ export default { } as ComponentMeta; // More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args -const Template: ComponentStory = () => ; +const Template: ComponentStoryFn = () => ; export const Example = Template.bind({}); Example.parameters = { diff --git a/docs/snippets/react/component-story-with-accessibility.ts.mdx b/docs/snippets/react/component-story-with-accessibility.ts.mdx index 84fd419b4457..3112d36e2c3c 100644 --- a/docs/snippets/react/component-story-with-accessibility.ts.mdx +++ b/docs/snippets/react/component-story-with-accessibility.ts.mdx @@ -3,7 +3,7 @@ import React from 'react'; -import { ComponentStory, ComponentMeta } from '@storybook/react'; +import type { ComponentStoryFn, ComponentMeta } from '@storybook/react'; import { Button } from './Button'; @@ -19,7 +19,7 @@ export default { } as ComponentMeta; -const Template: ComponentStory = (args) =>