Skip to content

Commit

Permalink
docs: specify configuration options (#28)
Browse files Browse the repository at this point in the history
* docs: specify configuration options

* docs: update config title

* docs: update to have an image in the description
  • Loading branch information
dannyhw authored Dec 15, 2021
1 parent 025cb9b commit 8c08724
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ You can read more about this package [in this blog post](https://www.dannyhwilli

To contribute see the contributing guide [here](https://github.com/storybookjs/addon-react-native-web/blob/main/CONTRIBUTING.md)

Heres a screen shot of you could use this alongside storybook/react-native, the image is taken from the following [starter code](https://github.com/dannyhw/expo-storybook-starter)

![image with storybook on mobile and web](https://user-images.githubusercontent.com/3481514/145904252-92e3dc1e-591f-410f-88a1-b4250f4ba6f2.png)

## Getting Started

Assuming you've got an existing RN project, run the following from the project root:
Expand All @@ -40,12 +44,17 @@ the [Storybook for React](https://storybook.js.org/docs/react/get-started/introd

Please see the [FAQ](https://github.com/storybookjs/addon-react-native-web/blob/main/FAQ.md) for common issues like the "loader not found" error.

## Extra config
## Config options

Most packages should work without extra changes however in some cases extra steps are needed.

One common example is "reanimated" which requires some babel config and extra transpilation.

Options | Type | Description
---------|----------|---------
modulesToTranspile | `Array<string>` | node_modules that need transpiling
babelPlugins | `Array<string>` | Babel plugins you want to apply
projectRoot | `string` | Path to the root of your project, if in a mono repo you might need to set this.

### Untranspiled react native libraries

Many react-native packages are shipped untranspiled and this doesn't work for the web platform. If you receive errors like "proper loader not found" after adding a package try adding it to the `modulesToTranspile` option for this addon.
Expand Down

0 comments on commit 8c08724

Please sign in to comment.