Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Co-locate stories with components. #103

Closed
philcockfield opened this issue Oct 4, 2016 · 5 comments
Closed

Co-locate stories with components. #103

philcockfield opened this issue Oct 4, 2016 · 5 comments

Comments

@philcockfield
Copy link

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)

@thani-sh
Copy link
Contributor

thani-sh commented Oct 4, 2016

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.

@philcockfield
Copy link
Author

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

@ckothari
Copy link

+1

@skovhus
Copy link

skovhus commented Mar 23, 2017

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

But would be great to avoid the build step.

@ndelangen
Copy link
Contributor

Please open an issue over at the new repo if you're still experiencing this issue, thanks!

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

No branches or pull requests

5 participants