Skip to content

Commit

Permalink
Fix types in custom stories implementation snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
kylegach committed Jan 25, 2024
1 parent 7bbf75f commit 7aafb03
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/snippets/common/main-config-stories-with-logic.ts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@

// Replace your-framework with the framework you are using (e.g., react-webpack5, vue3-vite)
import type { StorybookConfig } from '@storybook/your-framework';
import type { StoriesEntry } from '@storybook/types'

async function findStories() {
async function findStories(): Promise<StoriesEntry[]> {
// your custom logic returns a list of files
}

const config: StorybookConfig = {
framework: '@storybook/your-framework',
stories: async (list) => [
stories: async (list: StoriesEntry[]) => [
...list,
// 👇 Add your found stories to the existing list of story files
...(await findStories()),
Expand Down

0 comments on commit 7aafb03

Please sign in to comment.