Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated React Native files do not work with storybook in a vanilla app. #1200

Closed
tmeasday opened this issue Jun 6, 2017 · 3 comments
Closed
Labels

Comments

@tmeasday
Copy link
Member

tmeasday commented Jun 6, 2017

I was putting together a RN app for #1012, and ran into. I followed the following steps:

npm install -g react-native @storybook/cli
cd examples
react-native init ReactNativeVanilla

cd ReactNativeVanilla
# test that RN works :+1:
react-native run-ios

getstorybook
yarn run storybook
# storybook server/UI runs on port 7007

# run the app again, should see stories
react-native run-ios

At this stage I should see stories in the simulator, ie, something like
screenshot 2017-06-06 12 43 42

However, what I see is the standard starting app:
screenshot 2017-06-06 12 44 55

And no stories show in the UI.

I believe the problem was introduced by 3e2673b, which means that getstorybook creates storybook/index.js rather than storybook/index.[ios|android].js. Changing the filename myself and restarting things fix the issue.

I can't find documentation but I think the core problem is in setting --projectRoot=[configDir,projectDir] here https://github.com/storybooks/storybook/blob/master/app/react-native/src/bin/storybook-start.js#L49, the RN packager will look for and index.ios.js in configDir (i.e. ./storybook), and failing that, revert to the the projectDir.

tmeasday added a commit that referenced this issue Jun 6, 2017
Reverting from 3e2673b -- this broke RN-storybook for `getstorybook` users.

See #1200
@tmeasday tmeasday self-assigned this Jun 6, 2017
tmeasday added a commit that referenced this issue Jun 6, 2017
Reverting from 3e2673b -- this broke RN-storybook for `getstorybook` users.

See #1200
tmeasday added a commit that referenced this issue Jun 6, 2017
Reverting from 3e2673b -- this broke RN-storybook for `getstorybook` users.

See #1200
tmeasday added a commit that referenced this issue Jun 6, 2017
Reverting from 3e2673b -- this broke RN-storybook for `getstorybook` users.

See #1200
tmeasday added a commit that referenced this issue Jun 6, 2017
Reverting from 3e2673b -- this broke RN-storybook for `getstorybook` users.

See #1200
@tmeasday tmeasday added the bug label Jun 8, 2017
@tmeasday tmeasday removed their assignment Jun 8, 2017
@tmeasday
Copy link
Member Author

tmeasday commented Jun 8, 2017

This issue should be labelled merged but that label is gone, not sure why (@shilman?)

@shilman
Copy link
Member

shilman commented Jun 8, 2017

@tmeasday No idea what happened to merged?

@shilman
Copy link
Member

shilman commented Jun 14, 2017

This went out last week. Follow up issue: #1277

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants