Expo Router

Also called File-based routing

Also known as
File-based routing
Updated

What is Expo Router in React Native?

Expo Router is a file-based routing library for React Native. Files in the app directory become routes, with deep links and typed navigation derived automatically.

Expo Router brings file-based routing to React Native. The layout of your app/ directory is the navigation structure, the same convention Next.js uses on the web.

app/
  _layout.tsx      → wraps every route
  index.tsx        → /
  settings.tsx     → /settings
  post/[id].tsx    → /post/42

It is built on React Navigation rather than replacing it, so the underlying navigators — stack, tabs, drawer — are the same ones. What Expo Router adds is convention: routes come from the filesystem instead of a hand-maintained config object.

Three things newcomers get for free:

  • Deep linking. Every screen has a URL, so a push notification or a shared link can open it with no extra wiring.
  • Typed routes. href values are checked against the routes that actually exist.
  • Web support. The same tree renders as a real website through React Native Web.

See the Expo Router docs.