Is there a way to get this working with Exponent?
elie222 opened this issue · 10 comments
Hi,
I use Exponent to develop. Has anyone managed to get Storybook working with Exponent?
https://getexponent.com/
Yep, use https://github.com/storybooks/react-native-storybook/blob/master/docs/manual-setup.md as usual and use the exported component as entry point in your App.js
(and start the storybook server). See https://github.com/serlo-org/serlo-abc/tree/expo for a working example. If needed, I can create a repository with a minimal example. Feel free to ping me again if you run into any problems. :)
I created a blog post about that: https://medium.com/p/using-react-native-storybook-with-create-react-native-app-471e531bb128
I'm pretty sure that you can apply the same principles. Feel free to ask again, though, if you run into any problems. Then I look again (I'm not really sure what CRNA brings over Expo)
Please open an issue over at the new repo if you're still experiencing this issue, thanks!
@inyono as you mentioned in your blog medium.com
which is mostly obsolete, there should be a scripts-overriding in order to start with Create React Native App
.
Since this question is about Expo, do you have an idea how it could be exactly integrated with it. I could not find my way into it.
@amed not sure what you mean? Are you talking about the changes to the npm scripts? If so, something like
"start": "concurrently --kill-others \"storybook start -p 7007\" \"exp start\""
should work in your case (if you want to start both storybook and the app itself). If you don't use the CLI, you have to start the storybook from your command line and start your app in the way you usually do.
I am on the latest version of Expo ^22.0.0
, I tried to follow the approach that is here at your repo: https://github.com/inyono/crna-storybook
Since the package name now called @storybook/react-native
instead of @kadira/react-native-storybook
there was an error asking for @kadira/react-native-addons
which was a dead-end for mounting storybook with the latest sdk.
PS: cloning crna-storybook
and starting it is working good with expo.
Yeah, https://github.com/inyono/crna-storybook is still using Storybook 2. You can find a working version for Storybook 3 at https://github.com/serlo-org/serlo-abc.
Relevant for you:
- https://github.com/serlo-org/serlo-abc/tree/master/storybook. You won't need
loadFonts
, just exportStorybookUI
. - https://github.com/serlo-org/serlo-abc/blob/master/package.json. You'll only need the
storybook
task and the two@storybook/*
dependencies.
If you still run into issues, feel free to ping me again, then I will create a small working example for expo.