Quick Start Guide
Get started with React Router by building a simple application in your preferred mode.- Framework Mode
- Data Mode
- Declarative Mode
Framework Mode Quick Start
Build a type-safe, full-stack app with automatic code splitting and SSR.1
Create project structure
Create the following files:
2
Configure routes
Define your routes in
app/routes.ts:app/routes.ts
3
Create root layout
Set up your app shell in
app/root.tsx:app/root.tsx
4
Create index route
Add your first route with a loader in
app/routes/_index.tsx:app/routes/_index.tsx
5
Run your app
Framework Mode automatically generates TypeScript types in
.react-router/types/ for full type safety across your routes.Add More Routes
Create additional routes using file-based routing conventions:app/routes/about.tsx
app/routes/blog.$slug.tsx
Comparison at a Glance
Next Steps
Routing Concepts
Learn about nested routes, layouts, and navigation
Data Loading
Master loaders, actions, and data mutations
Type Safety
Set up end-to-end type safety in Framework Mode
Deployment
Deploy your React Router app to production