When an Expo Router app boots, it picks the first route alphabetically by default — which is rarely what you want once /login, /onboarding, and /home all live in the same directory. The fix is the initialRouteName prop on the Slot (or Stack) component, which tells the router which screen to mount first regardless of file order.
The full post shows the one-line change in practice, wrapped in a QueryClientProvider, and explains how Expo Router builds on React Navigation under the hood — so the same mental model carries over once you outgrow the file-based defaults.
Originally published at andreasbergstrom.dev — read the full post there.
Top comments (0)