Software Developer
Markdown supported · ⌘↵ to post
Thanks for the guide!
I recently created a new project with expo-router and I was confused with the app/ folder
One suggestion tho
my launch script looks like this
"storybook": "sb-rn-get-stories && EXPO_PUBLIC_STORYBOOK_ENABLED='true' expo start",
and the index.tsx page
const storybookEnabled = process.env.EXPO_PUBLIC_STORYBOOK_ENABLED;
I don't have .env file, no need to manually edit, it's faster to swap between the app or the storybook with
yarn start
yarn storybook
Mauro Garcia
Glad to help, David! And thanks for your comment about the alternative. I implemented the .env file that way for 2 main reasons: 1 - It works on any OS, including Windows 2 - I wanted to experiment with the new Expo env variables support
Adding the env flags directly in the package.json may be convenient, but I'll need to use cross-env or something similar so it can work on Windows.
Hayata Suenaga
I really enjoyed the article, and it was very helpful in getting started with setting up Storybook in my Expo project.
Now, as I'm trying to create a production build, I have a new question. How can we ensure that the production build doesn't include Storybook code?
Switching the real and Storybook application conditionally inside the code doesn't prevent Metro from bundling Storybook code.
I'm currently exploring a solution to this issue, but if you have any suggestions, I would greatly appreciate it if you could share your thoughts.