Expo Router: File-Based Navigation for React Native
How Expo Router works: file-based routes, layouts, dynamic segments, typed routes and universal links, plus when to pick it over React Navigation.

What Is Expo Router?
Expo Router is a file-based router for React Native and the web. You create a file inside the app directory, and that file becomes a screen. The folder structure is the navigation structure. No route config objects, no manual screen registration.
If you know Next.js, you already know Expo Router. The mental model is the same: files map to URLs, folders map to nested routes, and layout files wrap the screens below them. That is the whole point. One routing model for your mobile app and your web app.
Under the hood, Expo Router is built on top of React Navigation. You still get native stacks, tabs and drawers with real native transitions. Expo Router just replaces the imperative setup with files and URLs, and it gives every screen a path you can link to.
Why Use File-Based Routing in React Native?
Navigating by creating files in an app directory feels far more natural than the imperative boilerplate of classic react-navigation setups. You stop wiring navigators by hand and stop keeping a separate list of screen names in sync with your components.
The bigger win is that every screen has a URL. That one decision fixes a lot of problems at once. Deep linking is solved out of the box. Sharing a screen is sharing a path. Web support comes almost for free, because a URL is already how the web works.
It also makes codebases easier to read. A new developer opens the app folder and sees the product map. They do not have to trace navigator definitions across five files to find where a screen lives.
- Screens are files, so the folder tree documents your navigation
- Every screen gets a URL, which gives you deep links by default
- The same routes can render on iOS, Android and the web
- Layouts keep shared UI like headers and tab bars in one place
How Expo Router Works: Routes, Layouts and Dynamic Segments
A file named index.tsx inside app is your home route. A file at app/settings.tsx becomes /settings. Nest folders to nest paths: app/user/profile.tsx is /user/profile.
Layout files are named _layout.tsx. A layout wraps every route in its folder and decides how they are presented. Export a Stack from expo-router to get a native stack, or Tabs to get a tab bar. The root layout at app/_layout.tsx is also where you put providers like your theme, auth or data-fetching client.
Dynamic segments use square brackets. A file at app/user/[id].tsx matches /user/42 or /user/mustapha. Inside the screen, read the value with the useLocalSearchParams hook. Catch-all routes use the spread form, like [...rest].tsx.
Folders wrapped in parentheses are groups. A folder like (tabs) or (auth) organizes files and lets you attach a layout without adding a segment to the URL. This is how you put a tab navigator around a set of screens while keeping clean paths.
To move between screens, use the Link component with an href, or call router.push and router.replace from the useRouter hook when you need to navigate from code, for example after a form submits.
How to Use Typed Routes in Expo Router
Typed routes are one of the best parts of Expo Router. The router can statically analyze your app directory and generate TypeScript types for every route. The result: you can't navigate to a screen that doesn't exist. A typo in an href becomes a compile error.
That catches broken links at build time, not at runtime in front of a user. On a growing app, where screens get renamed and moved, this is the difference between a confident refactor and a week of hunting dead links.
Typed routes are switched on through your app config, and the exact setting has changed across Expo SDK releases. Check the Expo Router docs for the SDK you are on instead of copying an old snippet. Once it is on, the types are regenerated as you add or rename files while the dev server runs.
Deep Linking and Universal Links with Expo Router
The killer feature is universal links. A single href like /user/mustapha works on iOS as a Universal Link, on Android as an App Link, and on the web as a normal URL. One link, three platforms, same screen.
That makes shareable app content something any team can ship. A user shares a profile or a product page. The recipient taps it. If the app is installed, it opens the right screen. If not, the web version of the same route loads.
Custom-scheme deep links work with little more than a scheme set in your app config. Real universal links need a bit more setup outside your code. On iOS you add associated domains and host an apple-app-site-association file on your domain. On Android you add intent filters and host an assetlinks.json file. Expo's config handles the app side, but the files on your domain are on you.
Common Expo Router Mistakes
Most issues come from treating Expo Router like the old imperative setup. A few patterns show up again and again.
- Putting non-route files like components or utils inside the app folder, where they get treated as routes. Keep them outside app.
- Forgetting that a layout wraps everything in its folder, then wondering why a header shows up on the wrong screen
- Using groups and dynamic segments in a way that makes two files resolve to the same URL
- Assuming universal links work after setting a scheme. You still need the domain verification files.
- Copying typed routes or config snippets from an older SDK without checking the current docs
Frequently Asked Questions
Is Expo Router the same as Next.js routing?
Not the same code, but the same idea. Both use file-based routing where files in an app directory map to URLs and layout files wrap nested routes. If you have built with the Next.js App Router, Expo Router will feel familiar right away.
Does Expo Router replace React Navigation?
No. Expo Router is built on top of React Navigation. It replaces the manual navigator configuration with file-based routes, but the stacks, tabs and transitions underneath are still React Navigation.
Can I use Expo Router without Expo?
Expo Router is designed around the Expo toolchain, including its bundler config and CLI. You can add Expo packages to an existing React Native app, but if you want Expo Router, the smoothest path is a project set up with Expo.
How do I pass parameters between screens in Expo Router?
Put them in the URL. Use a dynamic segment like [id].tsx for required values, or query parameters for optional ones, then read them in the target screen with useLocalSearchParams. Keep params small and serializable, and fetch the full data on the screen.
Does Expo Router support the web?
Yes. The same routes render on the web, and every screen gets a real URL. That is a big part of why universal links and shareable content work so well with it.
Keep reading
All guides →
How to Add AI to a React Native App (Step by Step)
Add AI to a React Native app the safe way: keep API keys on your backend, stream responses to the UI, send camera photos, and handle errors and cost.

Expo Native Modules: Config Plugins and the Modules API
How to use native iOS and Android code in Expo without ejecting: config plugins, prebuild, the Expo Modules API in Swift and Kotlin, and development builds.

On-Device AI: The Next Frontier for React Native
Why I'm moving inference from the cloud to the edge. A practical guide to running TensorFlow Lite and CoreML directly in React Native apps.