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
<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 navigationUsed in exercises
Exercise 4.4 · Expo app shell Exercise 4.7 · API client and auth screensPrerequisite conceptsRoute group
RelatedExpo Router