Skip to main content

Expo Router root

Expo Router is configured to use apps/mobile/app in apps/mobile/app.json. Route groups such as (public), (app), (modal), and (onboarding) organize navigation without adding those group names to URLs. The Nx project sets sourceRoot to apps/mobile/src, but that value does not change the Expo Router root.
The current @amisi-mobile-starter/generators:screen implementation writes route files to apps/mobile/src/app. Those files are not active routes. Put route files under apps/mobile/app instead.

Metro monorepo configuration

apps/mobile/metro.config.js starts from Expo’s default Metro config, wraps it with withNxMetro, and sets the workspace root as a watch folder. It also:
  • resolves dependencies from app and workspace node_modules
  • disables hierarchical lookup to reduce duplicate React and React Native resolution
  • adds cjs, mjs, svg, and css source extensions
  • removes svg from asset extensions
  • applies Uniwind with apps/mobile/src/global.css
Keep these layers when customizing Metro. Replacing the file with a plain Expo config can break workspace package resolution, SVG imports, styling, or Expo Router’s require.context support.

Dependency alignment

Install Expo-managed native dependencies with Expo’s installer from the mobile app context:
Use versions compatible with the repository’s Expo SDK, React, and React Native versions. Avoid solving peer warnings by pinning a second React or React Native copy inside a workspace package.

Native configuration changes

Changes to apps/mobile/app.json, apps/mobile/app.config.js, Expo plugins, permissions, icons, splash assets, or native dependencies can require a new prebuild or native build. An over-the-air update cannot apply native configuration changes. Run bun run doctor after dependency or Expo configuration changes, and finish with: