Menu

Expo Router in one sitting: build a 4-screen app and learn file-based routing on the way
πŸ“°

Expo Router in one sitting: build a 4-screen app and learn file-based routing on the way

DEV Community: reactnativeΒ·Russel DsouzaΒ·2 days ago
#paiO4dUf
#devtoreactnative#devto#dev#note#router
Long article (841 words) β€” no AI summary yet.
Reading 0:00
15s threshold

If you've used Next.js, Expo Router will feel familiar: files in an app/ folder become screens, folders become URL segments, and _layout files decide how screens are wrapped. If you haven't, this is the fastest way to see why it beats hand-wiring a navigator.

We'll build a tiny notes app with four screens: a tab bar with Home and Settings, a note detail screen, and a modal for creating a note.

Setup

npx create-expo-app@latest notes-app cd notes-app npx expo start

Enter fullscreen mode

Exit fullscreen mode

The default template already uses Expo Router. Delete the example screens if you want a clean slate, and keep app/_layout.tsx .

The folder structure is the navigation

Here's the whole app:

app/ _layout.tsx root stack (tabs)/ _layout.tsx tab bar index.tsx Home β†’ / settings.tsx Settings β†’ /settings note/ [id].tsx Note detail β†’ /note/42 new-note.tsx Modal β†’ /new-note +not-found.tsx anything else

Enter fullscreen mode

Exit fullscreen mode

Three conventions are doing the work:

_layout.tsx wraps…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.