Ship a New Feature with Expo Router Without Rewriting Your Navigation
Add file-based routing to an existing React Native app incrementally, keep legacy React Navigation screens, and verify deep links before shipping.
20 Oct 2025, 13:06 UTC

A navigation decision that doesn't have to be all-or-nothing
You maintain a React Native app built with React Navigation. A new feature needs a dynamic screen, such as an order detail page reachable at /orders/[orderId], and it should support deep links. Rewriting the whole navigation layer just to add one feature is expensive, but sticking with imperative stacks means manually casting parameters and touching several files every time you add a route.
The useful takeaway: you can adopt Expo Router incrementally for the new feature while leaving existing React Navigation screens in place. Expo Router is file-based routing built on React Navigation, so the two can coexist, but the seam needs deliberate configuration and testing.
What changes when you add Expo Router
Expo Router defines screens from files in an app directory. app/index.tsx becomes the index route, app/orders/[orderId].tsx becomes a dynamic route where [orderId] is a dynamic segment, and folders wrapped in parentheses like (tabs) are route groups that organize files without changing the URL path. Because it is built on React Navigation, you get navigation primitives such as <Link> and route types, but the file name is now part of the navigation contract.
Terms worth keeping straight: file-based routing means the filesystem determines available paths; a dynamic segment is a placeholder in the path that captures a value; a development build is a custom client build needed for some native modules and custom deep-link schemes, while Expo Go is the sandbox client for quick testing.
Worked example: add an orders detail route
Run this in your project root to add the router and its common peer dependencies:
npx expo install expo-router react-native-safe-area-context react-native-screens
npx expo install pins versions to your Expo SDK, which reduces the risk of a version mismatch. No special filesystem permissions are required beyond normal write access to the project. A risk is that adding the dependency changes your lockfile, so review the diff before committing.
Create the root layout and routes:
app/layout.tsx
import { Router } from 'expo-router';
export default function RootLayout() {
return <Router />
}
app/index.tsx
import { Link } from 'expo-router';
import { View, Text } from 'react-native';
export default function Home() {
return (
<View>
<Text>Home</Text>
<Link href='/orders/abc-123'>Open order abc-123</Link>
</View>
)
}
app/orders/[orderId].tsx
import { View, Text } from 'react-native';
export default function OrderScreen() {
return (
<View>
<Text>Order detail screen</Text>
</View>
)
}
To read the dynamic orderId value, use the route-params hook documented for your installed @expo/router version; the exact API has changed between major versions, so check the docs rather than copying a snippet from an unrelated release.
Verify the route and deep link
- Start the dev server from the project root:
- Open the app in Expo Go or a development build, tap the link on the home screen, and confirm the order screen mounts without a 'Cannot find route' error.
- Open package.json and confirm @expo/router appears in dependencies with a version matching your SDK.
- For deep links, file names alone are not enough. Configure your scheme in app.json and test with a command such as:
npx expo start
npx uri-scheme open myapp://orders/abc-123
Replace myapp with your configured scheme. Custom schemes may require a development build; Expo Go supports exp:// URLs but not every custom scheme configuration.
Trade-offs and when to hold off
- Renaming a route file changes its URL, so the filesystem becomes part of your public navigation surface.
- Missing parentheses on a route group can break the expected path structure without an obvious syntax error.
- Not every community React Navigation navigator has a file-based equivalent; custom navigators may still require imperative setup.
- Upgrading the Expo SDK can introduce breaking changes to router APIs or required package versions.
Rollback
Because adding routes and a dependency changes project state, roll back by removing the new app files, running npx expo uninstall expo-router react-native-safe-area-context react-native-screens only if those packages are no longer used, reverting any app.json changes, and restarting the dev server.
Closing
Use Expo Router for the new feature when you want type-friendly, file-defined routes and can verify deep links in a development build. Keep legacy screens in React Navigation until the team is ready to migrate them. The practical check is simple: start the dev server, open the dynamic route, and confirm the deep link lands on the right screen before you ship.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.