This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.

Expo Router

A file-based routing library for React Native and web applications.

Android
iOS
tvOS
Web
Included in Expo Go
Recommended version:
~56.2.21

expo-router is a routing library for React Native and web apps. It enables navigation management using a file-based routing system and provides native navigation components.

Expo Router guides

Learn about Expo Router basics, navigation patterns, core concepts, and more.

Installation

To use Expo Router in your project, you need to install. Follow the instructions from the Expo Router's installation guide:

Install Expo Router

Learn how to install Expo Router in your project.

Configuration in app config

If you are using the default template to create a new project, expo-router's config plugin is already configured in your app config.

Example app.json with config plugin

app.json
{ "expo": { "plugins": ["expo-router"] } }

Configurable properties

NameDefaultDescription
root"app"

Changes the routes directory from app to another value. Avoid using this property unless you have a specific need.

originundefined

Production origin URL where assets in the public folder are hosted. The fetch function is polyfilled to support relative requests from this origin in production. The development origin is inferred using the Expo CLI development server.

headOriginundefined

A more specific origin URL used in the expo-router/head module for iOS handoff. Defaults to origin.

asyncRoutesundefined

Enable async routes (lazy loading). Can be a boolean, a string ("development" or "production"), or an object with platform-specific values ({ android, ios, web, default }). production is currently web-only and will be disabled on native.

platformRoutestrue

Enable or disable platform-specific routes (for example, index.android.tsx and index.ios.tsx).

sitemaptrue

Enable or disable the automatically generated sitemap at /_sitemap.

partialRouteTypestrue

Enable partial typed routes generation. This allows TypeScript to provide type checking for routes without requiring all routes to be statically known.

redirectsundefined

An array of static redirect rules. Each rule should have source, destination, and optionally permanent (defaults to false) and methods (HTTP methods to redirect).

rewritesundefined

An array of static rewrite rules. Each rule should have source, destination, and optionally methods (HTTP methods to rewrite).

headersundefined

A list of headers that are set on every route response from the server. The value can be a string or an array of strings.

disableSynchronousScreensUpdatesfalse

Disable synchronous layout updates for native screens. This can help with performance in some cases.

unstable_useServerMiddlewarefalse
Experimental

Enable server middleware support with a +middleware.ts file. Requires web.output: "server" to be set in app config.

unstable_useServerDataLoadersfalse
Experimental

Enable data loader support. This is only supported for web.output: "static" outputs at the moment.

unstable_useServerRenderingfalse
Experimental

Enable server-side rendering. When enabled with web.output: "server", HTML is rendered at request time instead of being pre-rendered at build time.

Usage

For information core concepts, notation patterns, navigation layouts, and common navigation patterns, start with Router 101 section:

Router 101

APIs

APIDescription
StackStack navigator, toolbar, and screen components
LinkLink and Redirect components
ColorPlatform color utilities
Native TabsNative tab navigation
Split ViewSplit view layout
UIHeadless tab components

API

import { useRouter, Tabs, Navigator, Slot } from 'expo-router';

No API data file found, sorry!