Use Storybook (with React Native for Web) in your Expo + Next.js monorepo
MIT License
Here is an example showing how to create a universal React app using Expo and Next.js in a monorepo.
You'll find included:
And ready-to-use (small configuration required):
Code shared between iOS, Android and Web
cd packages/app
Native
Expo entrypoint: packages/expo/App.tsx
cd apps/expo
yarn dev
to start iOS and Android app with Expo
Demo: https://expo.dev/@poolpoolpool/example?release-channel=production
Pro tip: build and launch a custom development client with SCHEME=com.example.axel yarn run:ios -d
(replace axel
with your first name)
Web
Next.js entrypoint: packages/next/src/pages/_app.tsx
cd apps/next
yarn dev
to start web app
Demo: https://expo-next-monorepo-example.vercel.app
Storybook for Web (using React Native for Web)
Storybook config: apps/storybook/.storybook/*
cd apps/storybook
yarn storybook
to start Storybook
yarn publish:production
yarn deploy
-- if it fails, make sure to configure your project correctly:packages/next
Here is an example of how to handle navigation: https://github.com/axeldelafosse/expo-next-monorepo-example/pull/1
Here are some ideas to get you started:
I also recommend to check out this example from Cedric: https://github.com/byCedric/eas-monorepo-example. It includes some EAS GitHub Actions and a bare workflow (ejected) example.