Skip to content

Commit

Permalink
Merge pull request #1420 from formatlos/refine-dynamic-loading-docs
Browse files Browse the repository at this point in the history
refine docs about loading stories dynamically for react-native
  • Loading branch information
ndelangen authored Jul 6, 2017
2 parents 62081e9 + 19c2db4 commit c081849
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/pages/basics/writing-stories/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ configure(loadStories, module);

Here we use Webpack's [require.context](https://webpack.github.io/docs/context.html#require-context) to load modules dynamically. Have a look at the relevant Webpack [docs](https://webpack.github.io/docs/context.html#require-context) to learn more about how to use require.context.

The **React Native** packager resolves all the imports at build-time, so it's not possible to load modules dynamically. If you don't want to import all your stories manually you can use [react-native-storybook-loader](https://github.com/elderfo/react-native-storybook-loader) to automatically create the import statements for all of your stories.

## Using Decorators

A decorator is a way to wrap a story with a common set of component(s). Let's say you want to center all your stories. Here is how we can do this with a decorator:
Expand Down

0 comments on commit c081849

Please sign in to comment.