Demonstrates the use of a Yarn Workspace Monorepo with Expo. This example installs a monorepo with an application using a separate custom package.
- Create a new monorepo with
npx create-react-native-app --template with-yarn-workspaces
. - Run
yarn watch-packages
to build and watch the packages. - Run
yarn start-app
to start the app. - Edit the code in packages/expo-custom/src and watch it live-reload in the app!
├── apps
│ └── mobile
│ ├── index.js ➡️ Entry point for the app
│ ├── App.js ➡️ App root component
│ ├── package.json ➡️ contains configuration required by expo-yarn-workspaces
│ └── metro.config.js ➡️ required by expo-yarn-workspaces
├── packages
│ └── expo-custom
│ └── src/index.tsx ➡️ exports a custom message which is imported and displayed in the app
│ └── src/tsconfig.json ➡️ default TypeScript configuration for expo-module-scripts
├── package.json ➡️ contains yarn commands to run applications
└── babel.config.js ➡️ Babel config (should be using `babel-preset-expo`)
This example uses the configuration described in the Expo Monorepos Guide