mirror of
https://github.com/zhigang1992/examples.git
synced 2026-04-30 02:16:13 +08:00
Storybook Example
Running in the browser
-
Create Expo project
expo init -
cd into the project and run
npx -p @storybook/cli sb init --type reactto bootstrap a new React project -
Install the expo webpack config so we can add unimodules support
yarn add -D @expo/webpack-config -
Create a custom webpack config
touch .storybook/webpack.config.jsconst { resolve } = require('path'); const webpack = require('webpack'); const withUnimodules = require('@expo/webpack-config/withUnimodules'); module.exports = ({ config }) => { return withUnimodules( config, { projectRoot: resolve(__dirname, '../'), } ); }; -
Run
yarn storybookto try it out!
Running in the client
TBD... Feel free to open a PR!
-> Usage with React Native (not universal) https://storybook.js.org/docs/guides/guide-react-native/
The idea behind the example
This example shows how to use Unimodules with Storybook for web. You can use Storybook to test and share your component library quickly and easily.