Allow default story to be infered from default export in CSF3 #21229
iamandrewluca
started this conversation in
Ideas
Replies: 1 comment
-
I think this request makes even more sense when you have The component view in the generated docs page will likely be the same as the one exported by the empty |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In most of the projects, our components/sections have a single story, so most of our stories looked like this in CSF2:
CSF2 Example with createDefaultStory
accordion.stories.ts
utils/storybook.ts
With the arrival of CSF3, we don't need anymore this
createDefaultStory
utility function that creates the story, we can use a simple object named export:accordion.stories.ts
Would be nice if there are no stories exported from the file, Storybook to automatically infer a default story from the
component
andtitle
fields, so we could get rid completely of the named exportAt the moment removing this single named export
StoryObj
, eslint will complain, and no stories will be detected by StorybookBeta Was this translation helpful? Give feedback.
All reactions