Protected route

Screens wrapped in Stack.Protected with a guard. While the guard is false they cannot be navigated to, even by deep link, and they are removed from the back history; when it flips, the navigator moves the user to the first available screen. Available from Expo SDK 53.

Minimal example

tsx
<Stack>
  <Stack.Protected guard={!isSignedIn}>
    <Stack.Screen name="(auth)" />
  </Stack.Protected>
  <Stack.Protected guard={isSignedIn}>
    <Stack.Screen name="(tabs)" />
  </Stack.Protected>
</Stack>

Learn this concept

Lesson 4.2 · Expo Router navigation

Used in exercises

Exercise 4.4 · Expo app shell Exercise 4.7 · API client and auth screens
Prerequisite conceptsRoute group