https://github.com/guyzmo/mcve-rnw-sb6
MCVE for Expo/RNW with SB6
https://github.com/guyzmo/mcve-rnw-sb6
Last synced: over 1 year ago
JSON representation
MCVE for Expo/RNW with SB6
- Host: GitHub
- URL: https://github.com/guyzmo/mcve-rnw-sb6
- Owner: guyzmo
- Created: 2021-08-09T17:04:54.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-09T17:19:35.000Z (almost 5 years ago)
- Last Synced: 2025-01-21T00:29:16.214Z (over 1 year ago)
- Language: TypeScript
- Size: 721 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Expo with Storybook 6 running RNW stories
This MCVE runs storybook 6 with RNW stories, thanks to a hack within the main.ts that replaces all calls to RN by calls to RNW.
## Run the code
To setup:
```
yarn
```
To launch storybook
```
yarn storybook
```
To run expo
```
yarn expo
```
## Issue
Whenever I try to load an external library (like react-native-eva-icons), I get an error such as the following one, featured in this repository:
```
Unexpected error while loading ./components/Button/Button.stories.tsx: ReferenceError: react is not defined
```
The issue is caused by the `import { Button } from "./Button"` import in the story, which itself is caused by the
`import { Icon } from "react-native-eva-icons";` import in `Button.tsx`.