
Expo Router Has a Free File-Based Routing for React Native — Next.js for Mobile
React Native routing used to require manual stack configuration. Expo Router brings file-based routing to mobile — the same pattern you know from Next.js. What is Expo Router? Expo Router is a file-based router for React Native and web. Drop a file in app/ , and it becomes a route. Works on iOS, Android, and web from the same codebase. Why Expo Router 1. File-Based Routing app/ ├── _layout.tsx → Root layout ├── index.tsx → / (home screen) ├── about.tsx → /about ├── settings/ │ ├── _layout.tsx → Settings layout (tabs) │ ├── index.tsx → /settings │ └── profile.tsx → /settings/profile ├── blog/ │ └── [slug].tsx → /blog/:slug └── (auth)/ ├── login.tsx → /login └── register.tsx → /register 2. Universal (iOS + Android + Web) // app/index.tsx — renders on ALL platforms import { View , Text , Pressable } from ' react-native ' ; import { Link } from ' expo-router ' ; export default function Home () { return ( < View style = { { flex : 1 , justifyContent : ' center ' , alignItems : ' center ' }
Continue reading on Dev.to JavaScript
Opens in a new tab




