Navigation
One screen apps are just sad websites.
▶ the lesson · narrated sketch video · tap for sound
the intro
Multi-screen apps need navigation: a stack that pushes and pops screens, tabs for top-level sections, and deep links that jump straight anywhere. React Navigation and Expo Router are the standard ways to build it.
fun fact ✦
Deep links are why tapping a notification can open the exact product page — not just the app.
the docs
the deep dive
the ideas behind the video — concepts, diagrams, a walkthrough and the traps to avoid
Web apps learned navigation from browsers: a URL per page, a back button, a history pile. Mobile has no URL bar, so navigation is just state — a tree of screens the library renders one at a time. Push adds to the pile, pop removes it, tabs switch between independent piles. Once you internalize that screens are data, deep links and auth flows stop feeling magical.
navigation is state, not pages
key terms
stack
Screens piled on top of each other. Push adds, pop removes, and the back gesture is a pop.
Feed → Post → backroute params
The payload you attach when navigating to a screen — an id, a query, a flag.
navigate('Post', { id: 42 })tab navigator
Parallel top-level sections, each keeping its own stack and scroll position.
Home | Search | Profiledeep link
A URL scheme that maps a path straight to a screen, no home-screen detour.
myapp://product/42how it works
- 1Wrap the app
NavigationContainer hosts the navigation state; inside it you place your root navigator.
- 2Declare a stack
List your screens once with Stack.Screen. Each gets a name and a component.
- 3Navigate with params
navigation.navigate moves between screens, carrying data in route.params.
- 4Nest tabs around stacks
Each tab owns a stack, so Home can be three screens deep while Search sits at its root.
- 5Wire deep links
Register a scheme and a path-to-screen mapping so notifications land on the exact screen.
the code, explained
a screen that reads its params, and the push that feeds it
side by side
React Navigation
- compose navigators in code
- works with or without Expo
- you wire deep links by hand
- maximum control, more boilerplate
Expo Router
- the file system is the route map
- typed links + deep links built in
- conventions over config
- Expo projects only
Popping a screen unmounts it — scroll position, typed text, unsent forms, all gone. Android's hardware back button is a pop too, so this bites Android users first. Keep state that matters in params, context, or storage, and prefer navigate() over push() to return to an existing screen instead of stacking a duplicate.
quick answers
Stack or tabs first?
Tabs for sections the user switches between all day; stack for drilling into detail. Real apps nest both — each tab contains a stack.
Why did my screen lose its state?
It unmounted when popped, or its parent re-rendered. React Navigation keeps tab state by default — look for remounts caused by inline component definitions or changing keys.
React Navigation or Expo Router?
Same engine underneath. Expo Router adds file-based routes and typed links on top — great inside Expo; plain React Navigation works anywhere.
quick hits about Navigation
short answers · interviews, tips, trivia & hidden gems