Expo Router v56 migration: replacing React Navigation imports
From the work/ 11 min read
Expo Router v56 no longer depends on React Navigation: the import map, the codemod we ran, third-party libraries, and what SDK 57 and 58 changed after it.
- React
- Migration
In this article (10)
Expo Router v56, which ships with Expo SDK 56, no longer depends on React Navigation: Expo forked the parts it used and they now live inside the package. Your app can no longer import from @react-navigation/*; those imports move to expo-router/react-navigation and three other entry points. The API is unchanged, and a codemod does most of it.
Below: what changed and what did not, the import map, the exact codemod command and what it does with the cases it cannot handle, what happens to third-party libraries, and how to test on iOS and Android. We checked it against Expo's May 28, 2026 announcement and the official guide, and ran the codemod on test files.
What changed in Expo Router v56
Expo SDK 56 shipped on May 21, 2026 with React Native 0.85 and React 19.2. A week later Expo explained its biggest change: Expo Router forked the parts of React Navigation it is built on. According to the post, Expo talked it through with Satya, who maintains React Navigation, and both agreed it was the best path for the two projects. The reasons are technical: deeper control over the internals for file-based routing, web and server rendering; less workaround code; and fewer version problems, since projects could end up with several copies of React Navigation installed.
The practical consequence is one sentence in the migration guide: in SDK 56 and later, Expo Router no longer supports importing from external @react-navigation/* packages in application code. Leave one in and the bundler stops. This is the message, as it appears in the Metro resolver of @expo/cli 56.1.27:
As of SDK 56, expo-router is no longer compatible with react-navigation.
For more information, see https://docs.expo.dev/router/migrate/sdk-55-to-56/.
You can disable this check by setting the environment variable
EXPO_ROUTER_DISABLE_RN_NAVIGATION_CHECK=1.
- The first line names the problem: the import comes from your code and points at
@react-navigation/*. - The second points to the official guide, which this article follows.
- The last two give the variable that turns the check off. It is an escape hatch, not a fix (more on what else it disables below).
If the import is from @react-navigation/native-stack or @react-navigation/drawer, the message adds the replacement: Stack from expo-router and Drawer from expo-router/drawer. A note on naming: the previous release was called Router v6, and Expo has changed the convention since, so the Expo Router version now follows the SDK. On npm, SDK 56 installs expo-router 56.x.
The release brings more that needs no migration work: streaming server-side rendering (the unstable_useServerRendering option), generateMetadata, the createStaticLoader and createServerLoader helpers, a SuspenseFallback you can export from a _layout, the Android toolbar, and a disabled prop on Native Tabs. The same SDK made Expo UI, SwiftUI and Jetpack Compose from React Native, stable.
Scroll the figure sideways to see all of it
What stays the same
The guide puts it plainly: the runtime API is unchanged, only the module specifiers move. ThemeProvider, DarkTheme, useIsFocused, useNavigation and HeaderBackButton keep their names and behave the same; what changes is where you import them from. Your routes in app/, your _layout files, Stack, Tabs, Link and useRouter already came from expo-router and stay as they are.
React Navigation does not go away either. Its team keeps maintaining it, and you can use it in an Expo project without Expo Router; the SDK 56 notes include the template (npx create-expo-app@latest --template react-navigation/template) and point out that both libraries build on react-native-screens. What no longer works is mixing them: with expo-router and react-navigation both installed, the SDK 56 expo-doctor warns you, because it is probably not what you meant.
The new import paths
This is the table from the SDK 55 to 56 migration guide. We read the codemod's source and it uses exactly the same map:
| Before (React Navigation) | After (Expo Router v56) |
|---|---|
@react-navigation/native | expo-router/react-navigation |
@react-navigation/core | expo-router/react-navigation |
@react-navigation/elements | expo-router/react-navigation |
@react-navigation/routers | expo-router/react-navigation |
@react-navigation/stack | expo-router/js-stack |
@react-navigation/bottom-tabs | expo-router/js-tabs |
@react-navigation/material-top-tabs | expo-router/js-top-tabs |
@react-navigation/native-stack | No direct equivalent: use the Stack layout |
@react-navigation/drawer | No direct equivalent: use the Drawer layout |
Scroll the figure sideways to see all of it
The guide's own example, with two imports you find in many Expo Router apps:
// Before (SDK 55)
import { ThemeProvider, DarkTheme } from '@react-navigation/native';
import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs';
// After (SDK 56)
import { ThemeProvider, DarkTheme } from 'expo-router/react-navigation';
import { createMaterialTopTabNavigator } from 'expo-router/js-top-tabs';
- The theme (
ThemeProviderandDarkTheme) came from@react-navigation/native; it now comes fromexpo-router/react-navigation, which groups what used to live innative,core,elementsandrouters. - Top tabs were created with the material-top-tabs package; the same function now comes from
expo-router/js-top-tabs. - The imported names do not change, and neither does the rest of the file.
One case the table does not mention. We checked the type declarations of expo-router 56.0.0 and 56.2.22: expo-router/js-stack only exports Stack, the JavaScript stack layout. If your code imported createStackNavigator or TransitionPresets from @react-navigation/stack, the new path does not have them on SDK 56 and TypeScript fails. Use the Stack layout from expo-router/js-stack instead. expo-router 57 does re-export them, and SDK 58 removes createStackNavigator again.
The codemod
The command is copied from the announcement and the guide. Run it from the project root and replace src with the folder or glob that holds your code (in many Expo Router projects that is app, plus maybe components):
npx expo-codemod sdk-56-expo-router-react-navigation-replace src
# or with another package manager
yarn dlx expo-codemod sdk-56-expo-router-react-navigation-replace src
pnpm dlx expo-codemod sdk-56-expo-router-react-navigation-replace src
bunx expo-codemod sdk-56-expo-router-react-navigation-replace src
We ran it with expo-codemod 58.0.1 (the current version on npm, which still ships this transform) on five test files. Three had plain named imports, one used import * as Nav, and one imported from native-stack. This is the output, trimmed:
Transforming 5 TSX files...
src/components/Legacy.tsx:1 - namespace import (import * as ...) from "@react-navigation/native" is not supported.
src/components/OldStack.tsx:1 - import from "@react-navigation/native-stack" cannot be migrated. Use the `Stack` layout (https://docs.expo.dev/router/advanced/stack/) instead
Results:
0 errors
2 skipped
3 ok
- 3 ok: the three files with named imports were rewritten.
- Namespace import: the codemod only rewrites named imports (
import { A } from). Withimport * asor a default import it leaves the file alone and asks you to change it by hand. We changed it toimport { useNavigation }, ran it again, and it passed. - native-stack: the whole file is skipped. Its other import, from
@react-navigation/native, which does have an equivalent, stayed untouched too. Until you replace the stack, that file keeps two old imports.
This is the test _layout.tsx, which had three React Navigation imports, before and after:
// Before
import { ThemeProvider, DarkTheme, DefaultTheme } from '@react-navigation/native';
import type { Theme } from '@react-navigation/native';
import { HeaderBackButton } from '@react-navigation/elements';
// After the codemod
import { ThemeProvider, DarkTheme, DefaultTheme, type Theme, HeaderBackButton } from "expo-router/react-navigation";
- All three imports pointed at packages that now share one target, so the codemod merged them into one.
- The type-only import (
import type { Theme }) survived as an inlinetype Theme. - The new line uses double quotes, and on Windows the file came back with CRLF line endings. Run your formatter and read the diff before you commit.
Scroll the figure sideways to see all of it
The result passes tsc --strict against the expo-router 56.2.22 types. Then look for leftovers. This command lists every import that still points at React Navigation; if it prints nothing, you are done:
grep -rnE "from ['\"]@react-navigation/" app src components
On our test files, before fixing the namespace import, it printed the three lines we expected: one in Legacy.tsx and two in OldStack.tsx. Adjust the folders to your project.
Third-party libraries
Many libraries still import from @react-navigation/core. So they keep working, Expo CLI rewrites those imports to expo-router/react-navigation when they come from node_modules. Your own code is not touched by this. The guide calls it a temporary compatibility shim and promises a guide for library authors before it goes away, and the announcement mentions a shared API that Expo and the React Navigation team are building for libraries that want to support both.
Mind the scope. In the @expo/cli 56 and 57 source, the rewrite only covers @react-navigation/core. A library that imports @react-navigation/native or another package resolves it like any dependency and may end up on a different React Navigation than your app. To find which dependencies pull them in:
npm ls @react-navigation/core @react-navigation/native
Every branch in that tree is a package that depends on React Navigation. Check its repository for an SDK 56 release and test the screen where you use it. With yarn or pnpm, yarn why or pnpm why do the same. Once your code no longer imports React Navigation, remove the @react-navigation/* packages you installed yourself from package.json and run npx expo-doctor again.
The EXPO_ROUTER_DISABLE_RN_NAVIGATION_CHECK=1 variable turns off both things at once: the library rewrite and the bundler error for your own code. Use it only to isolate a problem.
Testing on iOS and Android
Expo's upgrade guide follows this order: install the new expo, align dependencies, check the project. Then build on both platforms:
npm install expo@^56.0.0
npx expo install --fix
npx expo-doctor
npx expo start --clear
npx expo run:ios
npx expo run:android
npm install expo@^56.0.0moves the project to the new SDK.npx expo install --fixbrings the other Expo packages,expo-routerincluded, to that SDK's versions.npx expo-doctorchecks for common problems; on SDK 56 it also warns ifreact-navigationis still installed next toexpo-router.npx expo start --clearstarts Metro with an empty cache, so it does not serve stale imports.npx expo run:iosbuilds the iOS app locally (it needs a Mac with Xcode).npx expo run:androiddoes the same for Android.
What to check by hand, on both platforms: light and dark theme, headers and the back button, tabs, deep links, screens that use useIsFocused or useFocusEffect, and every screen that uses a third-party navigation library. If your app also runs on the web, open it there; that is where the new server rendering lives. And if the same upgrade moves native modules, read how to migrate to the React Native New Architecture first.
After v56: what SDK 57 and SDK 58 changed
This did not stand still. SDK 57 (June 30, 2026) is a small release: it moves React Native to 0.86 with no breaking changes in Expo Router. SDK 58 (October 15, 2026) changes a lot: it rebuilt the Expo Router navigation core and removed most of the API copied from React Navigation. According to the SDK 57 to 58 guide, expo-router/react-navigation no longer has, among others, NavigationContainer, React Navigation's Link or beforeRemove, and createStackNavigator is gone from expo-router/js-stack.
The temporary shim is gone as well. The Expo CLI changelog records in 58.0.2 (September 15, 2026) the removal of the Expo Router compatibility checks for @react-navigation packages. We confirmed it in @expo/cli 58.1.21: neither the error nor the rewrite is there. On SDK 58 that message is gone: if the old package is still installed, the import resolves to it without a warning, so the grep check matters more. Coming from 55, finish the v56 migration before moving on: Expo recommends upgrading one SDK at a time.
Common mistakes
- Running the codemod on
srconly. Many projects keep code inappandcomponents. Pass every folder, or a glob. - Reading "2 skipped" as done. Skipped files did not change. Fix them by hand and run it again.
- Expecting the codemod to migrate
native-stackordrawer. They have no equivalent: move to theStackandDrawerlayouts. - Importing
createStackNavigatorfromexpo-router/js-stackon SDK 56. OnlyStackexists there. - Leaving the environment variable set. It also turns off the error that flags stale imports in your code.
- Testing only in Expo Go, or on one platform. Build iOS and Android and test the screens that use navigation libraries.
- Jumping from 55 to 58 in one go. You stack two navigation migrations into one diff.
Frequently asked questions
Do I have to rewrite my navigation?
No. The API is the same; the import paths change. The exception is native-stack and drawer used directly, which move to the Expo Router layouts.
Can I keep using React Navigation?
Yes, in an Expo project without Expo Router. What is no longer supported is importing @react-navigation/* in an app that uses Expo Router.
What if a library breaks?
Use npm ls to see which React Navigation package it depends on. If it is core, Expo CLI 56 and 57 rewrite it; if it is another one, look for a newer release or open an issue with the library.
Does this apply if I am already on SDK 58?
Yes, the import migration is the base. On top of it, read the SDK 57 to 58 guide, because it removed several expo-router/react-navigation APIs and the bundler error that flagged old imports is gone.
Checklist
- The project is on SDK 55, on a clean branch, before you start.
expoon^56.0.0,npx expo install --fixrun,npx expo-doctorclean.- The codemod ran on every folder with code.
- Skipped files were fixed by hand and the codemod ran again.
native-stackanddrawermoved to theStackandDrawerlayouts.- The
grepfor old imports prints nothing. - Libraries that depend on React Navigation are identified and tested.
- The app builds and works on iOS and Android.
EXPO_ROUTER_DISABLE_RN_NAVIGATION_CHECKis not left set.
With the imports in place, the next decision is whether to move to SDK 57 and then 58, one at a time.
Saw this on Instagram? Comment ROUTER on the Reel and I'll send you the guide.
Written by

Published November 19, 2026