diff --git a/docs/_snippets/page-story-slots.md b/docs/_snippets/page-story-slots.md index eb68bff6ae67..d0422e89f244 100644 --- a/docs/_snippets/page-story-slots.md +++ b/docs/_snippets/page-story-slots.md @@ -273,9 +273,15 @@ import preview from '../.storybook/preview'; import { Page } from './Page'; +// Defines a custom type that combines the component props with custom story args to prevent type errors in the render function +// This is optional, but helps with type safety as args are inferred automatically in CSF Next +type PagePropsAndCustomArgs = React.ComponentProps & { + footer?: string; +}; + const meta = preview.meta({ component: Page, - render: ({ footer, ...args }) => ( + render: ({ footer, ...args }: PagePropsAndCustomArgs) => (