Menu

Migrating from React Navigation to Expo Router: A Step-by-Step Guide (With a Cheat Sheet)
πŸ“°

Migrating from React Navigation to Expo Router: A Step-by-Step Guide (With a Cheat Sheet)

DEV Community: mobileΒ·Russel DsouzaΒ·about 8 hours ago
#Psh6B0j9
#devtomobile#devto#dev#router#expo
Reading 0:00
15s threshold

Expo Router is built on React Navigation, so most of what you know carries over. Migration is mostly moving screens into an app/ folder: each navigator becomes a _layout.tsx , each screen becomes a file, navigation.navigate('Name', params) becomes router.push('/path') , route.params becomes useLocalSearchParams() , and your linking config disappears because every route is a deep link automatically. The cheat sheet at the end maps every common API.

If your app was started a few years ago, it probably has an App.tsx with a NavigationContainer , a stack, a tab navigator and a linking config that nobody wants to touch. Expo Router replaces that config with your folder structure. Here's how to get there without breaking the app.

Before you start

Your app should run on a recent Expo SDK. Upgrade first if you're several versions behind; doing both at once makes failures hard to trace.

Draw your current navigation tree. List every navigator, every screen and how screens nest.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.