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

Co-locate stories with components. #857

Closed
shilman opened this issue Apr 15, 2017 · 7 comments
Closed

Co-locate stories with components. #857

shilman opened this issue Apr 15, 2017 · 7 comments

Comments

@shilman
Copy link
Member

shilman commented Apr 15, 2017

Issue by philcockfield
Tuesday Oct 04, 2016 at 04:09 GMT
Originally opened as storybook-eol/react-native-storybook#103


Is there an equivalent way to find stories that sit alongside their components with a .stories extension like you can on web:

const req = require.context('../lib/view', true, /.stories.js$/);
configure(() => {
  req.keys().forEach(filename => req(filename));
}, module);

(ref: https://getstorybook.io/docs/basics/writing-stories)

@shilman
Copy link
Member Author

shilman commented Apr 15, 2017

Comment by mnmtanish
Tuesday Oct 04, 2016 at 05:18 GMT


React Storybook uses require.context to do that which is a Webpack feature. So far, we don't know of any equivalent feature in React Native bundler. I'll see what we can do to enable this.

@shilman
Copy link
Member Author

shilman commented Apr 15, 2017

Comment by philcockfield
Tuesday Oct 04, 2016 at 05:26 GMT


That would be awesome if it's in any way possible!! - thanks @mnmtanish

@shilman
Copy link
Member Author

shilman commented Apr 15, 2017

Comment by ckothari
Sunday Oct 30, 2016 at 09:26 GMT


+1

@shilman
Copy link
Member Author

shilman commented Apr 15, 2017

Comment by skovhus
Thursday Mar 23, 2017 at 14:32 GMT


Semi automated way here https://github.com/elderfo/react-native-storybook-loader

But would be great to avoid the build step.

@shilman shilman closed this as completed Apr 15, 2017
@slorber
Copy link
Contributor

slorber commented Jun 8, 2017

@shilman this issue is now closed, does it mean the "react-native-storybook-loader" is the recommended way to colocate stories for now?

@shilman
Copy link
Member Author

shilman commented Jun 8, 2017

@slorber tbh i'm not sure why this is closed. please give react-native-storybook-loader and feel free to reopen if you have problems with it!

@slorber
Copy link
Contributor

slorber commented Jun 8, 2017

thanks I was going to test it anyway, just wondering if a more viable solution to the problem has been found as colocation is a must have for me

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

No branches or pull requests

2 participants