Skip to content

Import all stories within a folder in Storybook RN #21854

Closed Answered by idrakimuhamad
idrakimuhamad asked this question in Documentation
Discussion options

You must be logged in to vote

Okay after trying to generate a project using the starter project, I notice there's this script that will automation edit the getStories based on the stories path you set at the main.js.

sb-rn-get-stories --config-path .ondevice

It is called on each of the storybook script so whenever you. add a new one, just need to re-trigger it again.

So inside the main.js just add the path to more stories:

module.exports = {
  stories: [
    "../components/**/*.stories.?(ts|tsx|js|jsx)",
    "../../../packages/ui/stories/**/*.stories.mdx",
    '../../../packages/ui/stories/**/*.stories.@(js|jsx|ts|tsx)'
  ],
  addons: [
    "@storybook/addon-ondevice-controls",
    "@storybook/addon-ondevice-actions",

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by idrakimuhamad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant