Skip to main content

Command Palette

Search for a command to run...

Keep unsigned users off product screens with one Expo Router root gate

Updated
1 min readView as Markdown
Keep unsigned users off product screens with one Expo Router root gate

If a product screen can mount before you know who is signed in, the file tree is doing the wrong job. The fix is not a Redirect at the top of every screen. It is a file convention that splits signed-out routes from product routes, plus one guard at the root stack that decides which group is allowed to exist.

Expo Router calls this protected routes. The current API is Stack.Protected with a guard boolean. The authentication guide uses the same idea with route groups. Older apps still use a layout-level Redirect. All three are the same product decision: evaluate auth before a home, settings, or billing screen is in the tree.

This post is only that gate.


This is an excerpt. Read the full post at otf-kit.dev/blog/expo-router-protected-routes-gate — full-stack kits your AI coding agent can actually ship to production. Browse the kits →

More from this blog

O

OTF — kits your AI coding agent can ship to production

617 posts

Engineering notes on shipping production apps with AI coding tools — Claude Code, Cursor, Codex, Lovable, Bolt — and the stack underneath: React Native, Expo, Next.js, Supabase. Honest takes on what works, what breaks, and the full-stack kits that get you to production faster. By OTF.