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

docs: add FAQ about no loader found error. #9

Merged
merged 3 commits into from
Nov 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions FAQ.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
## Won't the components be different on the web?
## No loader found for this type of file

If you get this error you are likely using a react native package that has not been transpiled. This is common practice with
many react native packages.
To resolve this add that package to the config of the addon like so.

```js
// main.js
module.exports = {
addons: [
/*existing addons,*/
{
name: '@storybook/addon-react-native-web',
options: {
modulesToTranspile: ['react-native-package-name'],
},
},
],
};
```

Also make sure to check the configuration section of the [readme](https://github.com/storybookjs/addon-react-native-web/blob/main/README.md#configuring-popular-libraries). If you want to add more packages to that section we're open to all PR's.

## Won't the compon ents be different on the web?

Basic components like View and Text should remain the same between platforms and library maintainers will generally attempt to keep things as similar as possible.

Expand All @@ -8,7 +31,7 @@ If you need the components to be accurate to how they would display on the devic

You could even use both addon-react-native-web and @storybook/react-native in the same project. For example you might want to use the web addon to share your ui with stakeholders and the native version to develop on (or whatever suits your needs).

This addon will not take away from storybook/react-native and as the maintainer of both packages I am invested in both solutions. This new addon is intended to solve issues such as sharing being difficult and missing features like the docs addon.
This addon will not take away from storybook/react-native and development on that package will continue. This new addon is intended to solve issues such as sharing being difficult and missing features like the docs addon.

In the future I see potential for both projects to interact with each other in a similar way that storybook react-native-server does with react native storybook and so I believe there is potential for the two to benefit each other.

Expand Down