React Native Server example with storybook 5
See original GitHub issueI’ve spent the past couple of days trying to get sb5 server running, but I end with a page without any stories populated. Only the device addons work. I’ve downgraded and upgraded using past issues as reference, but I’m still not seeing anything. I tried again today using version 5.1.0-alpha.36
which is set on all @storybook/*
packages, cleared cache and reinstalled. No luck. I’m also using the migration guide to set these up. https://github.com/storybooks/storybook/blob/next/MIGRATION.md#react-native-server
Is it possible someone could add a react native example that includes the server feature? It shouldn’t take more than 10 minutes, and it should help newcomers save hours spent on trying to get it to work. That would be much appreciated. Thanks
Issue Analytics
- State:
- Created 4 years ago
- Comments:38 (27 by maintainers)
Top GitHub Comments
Chiming in to say I’m experiencing the same issue. Created a new project using Expo v2.12.2 and Storybook v5.2.0-beta.0. I have tried with both a physical device and a simulator. What I’ve noticed is that I can’t seem to access the Storybook server over the network, e.g. navigating to
192.168.0.x:7007
in my phone’s browser shows nothingThat being said, I can access the Expo server from my phone so it’s not an issue with my network/PC. I’m going to make the assumption that Storybook is only permitting connections from
localhost
.…and this is exactly the case. Workaround for anyone who stumbles upon this:
-h 0.0.0.0
or if you’re worried about security, use-h [your local IP]
, where local IP is usually going to be something in the form of192.168.0.x
const StorybookUIRoot = getStorybookUI({host: "[IP used with -h]"});
[IP used]:7007
in its browserNote that these instructions assume you’re using the default port (which in my case is
7007
). If you’re using a custom port, you’ll need to updategetStoryBookUI
to use it.If you see this error at the end of the log:
adb: error: cannot bind listener: Operation not permitted
It’s because adb is requesting root access, so you’ll need to to run these two commands:
Try to to add the storybook port at the build command, like so:
react-native run-android --port=7007
make sure this error did not appeared:
adb: error: cannot bind listener: Operation not permitted
If that doesn’t work, you can try running: