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

Support react-native storybook #6

Open
thani-sh opened this issue Aug 26, 2016 · 8 comments
Open

Support react-native storybook #6

thani-sh opened this issue Aug 26, 2016 · 8 comments

Comments

@thani-sh
Copy link
Contributor

thani-sh commented Aug 26, 2016

Hi,
React Native Storybook supports addons form v2. The specifications addon doesn't seem to work out of the box with it. Got the error below when using with a simple repo. I'll try to find why we're getting this error and send a pull-request if I can.

If there are any Webpack Gurus around here, please check this out.

screen shot 2016-08-26 at 3 53 43 pm

@mthuret
Copy link
Owner

mthuret commented Aug 26, 2016

Is the repo can be access from outside ?

@thani-sh
Copy link
Contributor Author

Just pushed changes to react-native-button repo. Check the test-specs branch there.

To reproduce the error from a clean app:

npm -g i getstorybook
react-native init MyTestApp
cd MyTestApp
npm install -D storybook-addon-specifications
echo "import 'storybook-addon-specifications/register';" >> storybook/addons.js
npm run storybook
react-native run-ios

@thani-sh
Copy link
Contributor Author

thani-sh commented Aug 26, 2016

It works fine if I install the missing babel plugin.

screen shot 2016-08-26 at 6 34 55 pm 2

npm install -D babel-plugin-add-module-exports

This is entirely a storybook side issue.
I'll comment here when it's ready.

@thani-sh
Copy link
Contributor Author

Here's what I found so far:

React Native uses babel config from dependencies to transform them. This error comes when RN tries to use babel config from inline-style-prefixer module (loaded by aphrodite). Unfortunately we can't fix it from react-native-storybook.

The easiest fix is to avoid using aphrodite for now.


Let's assume we fix the above error. The next problem is getting enzyme to run inside react-native. It's also giving an error. To reproduce this error, try running this repo with npm start and react-native run-ios.

screen shot 2016-08-26 at 6 45 03 pm

@radwane-h
Copy link

Hey what is the status of the plug-in with react-native ?

@mthuret
Copy link
Owner

mthuret commented Jun 16, 2017

Well, if someone wants to give this a try, I'm all in to add this feature :)

@dan-kez
Copy link

dan-kez commented Oct 1, 2017

I would love for this addon work with react native.

@theeheng
Copy link

Am i right to think that this addon is only for react web? because normally react native addon package will have the prefix ''@storybook/addon-ondevice-****". Like knobs addon for web is @storybook/addon-knobs and for react-native is : @storybook/addon-ondevice-knobs

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

No branches or pull requests

5 participants