How to set up React Native Storybook with alternate dist directory (e.g. with TypeScript)?
See original GitHub issueThe default installation instructions create a ./storybook directory, but in our case we need all source to be in src for TypeScript. We compile to dist.
Moving storybook directory to src and compiling it doesn’t appear to work. We can get the server running with -c dist/storybook, but then the app runs normally - not showing any storybook content.
How can we get the storybook app to run with react-native run-ios when it’s in the ./dist/storybook directory?
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (3 by maintainers)
Top Results From Across the Web
How to set up React Native Storybook with alternate dist ...
The default installation instructions create a ./storybook directory, but in our case we need all source to be in src for TypeScript.
Read more >Setting up Storybook for React Native/TypeScript (server ...
Step 1: Install Storybook · Step 2: Conditionally render Storybook · Step 3: Boot Storybook · Step 4: Take care of asyncStorage warning...
Read more >Creating a React Component Library using Rollup, Typescript ...
js within the same directory. Now by running npm run build you should see Rollup do it's thing and create a /build folder...
Read more >Configure Storybook
Storybook is configured via a folder called .storybook , which contains various configuration files. Note that you can change the folder that Storybook...
Read more >How to structure your project and manage static resources in ...
In React Native, we often need to implement a button with an image background in many screens. Here is a simple one that...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@lukecwilliams it’s used for dealing with HMR
@roblafeve So far I don’t have a better answer for (1) above - I just have to modify jsBundleURLForBundleRoot.
Here’s what else I had to do to get running with storybook/RN/TS:
I’d still really like to know how to get storybook to find my index.ios.js file without my having to make temporary modifications to AppDelegate.m - I believe Storybook is supposed to be able to just find this file when the storybook packager is running!
(Side note: I was unable to get output to multiple directories with multiple tsconfig.json files in different folders, though comments elsewhere seemed to indicate this is possible. Although this would mean no danger of accidentally shipping ./dist/storybook directory, I think this would not actually help because AppDelegate.m is still pointing to dist for the entry file so wouldn’t find it.)