Expo Router · mid
Expo Router basics: files, layouts, params and typed routes
Expo Router turns files in the app directory into routes: each file is a screen and a URL, _layout files define navigators, (group) folders organise files without changing the URL, and [param] files are dynamic, so every screen is deep-linkable automatically.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- Notation: app/index.tsx = "/", app/profile/[id].tsx = "/profile/:id", [...slug] = catch-all, (tabs) = a group that does not appear in the URL, _layout.tsx wraps its siblings in a Stack, Tabs or Drawer. Special files: +not-found, +html (web), +native-intent, +middleware, and +api routes. New templates use src/app (SDK 55).
- Navigate with <Link href="/profile/42">, router.push / replace / back / navigate, or an href object { pathname: "/user/[id]", params: { id } }. Read params with useLocalSearchParams.
- Typed routes: experiments.typedRoutes: true generates types into expo-env.d.ts so Link href and router.push are type-checked (the docs still mark it beta; the template turns it on).
- Every screen is a URL, so deep links work automatically with the app scheme and universal links. Routes are lazy-loaded.
- Auth gating: <Stack.Protected guard={isSignedIn}> (also on Tabs and Drawer). It is client-side only, not a replacement for server-side checks.
- Since SDK 56, Expo Router no longer depends on React Navigation (Expo forked what it needs). Direct @react-navigation/* imports move to expo-router/react-navigation with npx expo-codemod sdk-56-expo-router-react-navigation-replace src.
The red pen
Common traps: mistake → fix
Mistake: "Expo Router is just a wrapper over React Navigation"
Fix: not since SDK 56.
Mistake: "A (group) folder adds to the URL"
Fix: groups never appear in the URL.
Mistake: "Protected routes secure my data"
Fix: they only hide screens; the server must check every request.
Easy to hard
Questions interviewers ask, easy to hard
- How does file-based routing map files to screens and URLs?
- What are layouts and groups for?
- How do you pass and read params with type checking?
- How do you keep signed-out users away from app screens?
- Expo Router or React Navigation for a new app? Why?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.