A clean starter template for React Native with Expo Router, TypeScript, and file-based routing.
# Install dependencies
npm install
# Start development server
npm startThen press a (Android), i (iOS), or w (web), or scan the QR code with Expo Go.
π For detailed setup instructions, see Getting Started Guide
This starter includes everything you need to build a production-ready React Native app:
- β React Native Paper - Material Design 3 components with dark/light mode
- β Dark/Light Mode - Automatic system preference detection
- β API Client - Axios with interceptors for authentication and error handling
- β Storage Service - AsyncStorage wrapper with TypeScript support
- β
Custom Hooks -
useFetchfor data fetching with loading/error states - β Error Boundary - Global error handling component
- β Loading States - Built-in loading screen component
- β Authentication Example - Complete login flow with token management
- β TypeScript - Full type safety throughout
- β ESLint + Prettier - Code quality and formatting tools
- β Example Screens - See features in action
This starter template provides multiple state management solutions to choose from. Each option is available as a separate branch with a corresponding pull request for easy review and integration:
Branch: state-management/redux
Pull Request: #2
A complete Redux Toolkit implementation with typed hooks, auth slice, and todos slice. Perfect for large-scale applications requiring predictable state management.
Features:
- Redux Toolkit with typed hooks
- Auth slice for authentication state
- Todos slice for todo management
- Full TypeScript support
Branch: state-management/react-context
Pull Request: #3
Built-in React Context API with useReducer for state management. No external dependencies required, perfect for smaller to medium-sized applications.
Features:
- AuthContext and TodosContext
- useReducer pattern for state updates
- Zero external dependencies
- Native React solution
Branch: state-management/zustand
Pull Request: #4
Lightweight and simple state management library with minimal boilerplate. Great balance between simplicity and power.
Features:
- Minimal boilerplate
- Simple API
- Small bundle size
- Easy to learn
Branch: state-management/jotai
Pull Request: #5
Atomic state management with fine-grained reactivity. Excellent for component-level state that needs to be shared across the app.
Features:
- Atomic state composition
- Fine-grained reactivity
- Great performance
- Flexible architecture
To try out any of these state management solutions:
-
Checkout the branch:
git checkout state-management/redux # or react-context, zustand, jotai -
Install dependencies:
npm install
-
Review the Pull Request to see what changes were made
-
Merge or cherry-pick the changes you want into your project
Each branch includes complete implementation examples and updated documentation.
For detailed installation and setup instructions, see the Getting Started Guide.
Quick overview:
- Prerequisites: Node.js v18+, npm/yarn
- Install:
npm install - Run:
npm start - Code: Start editing
app/(tabs)/index.tsx
This project uses Expo Router for navigation, which is the recommended approach for Expo projects. Expo Router provides:
- File-based routing - Files in the
appdirectory automatically become routes - Built on React Navigation - Full access to React Navigation APIs when needed
- Type-safe routes - Automatic TypeScript support for routes
- Deep linking - Automatic deep linking configuration
- Web support - Static rendering and optimized routing for web
React Native doesn't include built-in navigation, so you need a navigation library. Expo Router is built on top of React Navigation and integrates seamlessly with Expo CLI and bundling.
For more information, see:
npm start- Start Expo dev servernpm run android- Run on Android emulator/devicenpm run ios- Run on iOS simulator/devicenpm run web- Run in web browsernpm run lint- Check code qualitynpm run lint:fix- Fix linting issues automaticallynpm run format- Format code with Prettiernpm test- Run tests
react-native-starter/
βββ app/ # Expo Router screens (file-based routing)
β βββ (tabs)/ # Tab navigation screens
β βββ _layout.tsx # Root layout with theme provider
βββ components/ # Reusable UI components
β βββ ErrorBoundary.tsx
β βββ LoadingScreen.tsx
βββ hooks/ # Custom React hooks
β βββ useFetch.ts # Data fetching hook
βββ services/ # API & storage services
β βββ api.ts # Axios client with interceptors
β βββ storage.ts # AsyncStorage wrapper
βββ types/ # TypeScript type definitions
β βββ api.ts # API response types
βββ constants/ # App constants
β βββ Colors.ts # Color definitions
β βββ Theme.ts # React Native Paper theme
βββ assets/ # Images, fonts, static files
βββ docs/ # Documentation
Key directories:
app/- All screens go here. Files automatically become routes (Expo Router).components/- Reusable UI components used across screens.hooks/- Custom React hooks for shared logic (e.g.,useFetch).services/- API client and storage utilities.constants/- App-wide constants like colors and theme config.types/- TypeScript interfaces and types.
This project includes react-native-safe-area-context (installed with Expo Router) for handling safe areas on devices with notches and system bars.
Quick example:
import { SafeAreaView } from 'react-native-safe-area-context';
export default function Screen() {
return <SafeAreaView style={{ flex: 1 }}>{/* Your content */}</SafeAreaView>;
}See Safe Areas Guide for more information.
This project includes React Native Paper, a Material Design 3 component library. Paper provides pre-built, accessible components that automatically adapt to light/dark mode.
Quick example:
import { Button, Card, Text } from 'react-native-paper';
export default function Screen() {
return (
<Card>
<Card.Content>
<Text variant="titleLarge">Card Title</Text>
<Button mode="contained" onPress={() => console.log('Pressed')}>
Press me
</Button>
</Card.Content>
</Card>
);
}See UI Library Guide for more information on using React Native Paper components and customizing themes.
Assets (images, fonts, etc.) are stored in the assets/ directory. Import them directly:
import { Image } from 'react-native';
<Image source={require('./assets/icon.png')} />;See Assets Guide for more information.
This project uses environment variables for configuration. Copy .env.example to .env and fill in your values:
cp .env.example .envAll environment variables used in JavaScript must be prefixed with EXPO_PUBLIC_. See Environment Variables Guide for more information.
Expo CLI is installed automatically with the expo package. Common commands:
| Command | Description |
|---|---|
npx expo start |
Start the development server |
npx expo prebuild |
Generate native Android and iOS directories |
npx expo run:android |
Compile and run on Android |
npx expo run:ios |
Compile and run on iOS |
npx expo install <package> |
Install a library with compatible versions |
npx expo lint |
Lint your project files |
See Expo CLI documentation for more commands.
EAS CLI is used for building, submitting, and managing your app. Install it globally:
npm install -g eas-cliCommon commands:
eas build- Create development, preview, or production buildseas submit- Submit your app to app storeseas update- Create over-the-air (OTA) updates
See EAS CLI documentation for more information.
Diagnose issues in your Expo project:
npx expo-doctorThis command checks for common issues in app config, package.json, dependency compatibility, and overall project health.
Install the Expo Tools VS Code extension for:
- Autocomplete and IntelliSense for app config files
- Debugging with breakpoints and variable inspection
Orbit is a macOS and Windows app for:
- Installing and launching builds from EAS
- Installing and launching updates
- Testing on physical devices and emulators
Install with Homebrew (macOS):
brew install expo-orbitOr download from GitHub releases.
Snack is an in-browser development environment for:
- Sharing code snippets
- Experimenting with React Native
- Testing prototypes without local setup
Expo Go is a free app for testing your app on physical devices:
- Download from App Store (iOS)
- Download from Google Play (Android)
Note: Expo Go is great for learning and prototyping, but not recommended for production apps. Use development builds instead.
- Getting Started - Complete setup guide (start here!)
- How-To Guides - Common development tasks
- Code Conventions - Project standards and best practices
- API and Storage - Backend integration guide
- UI Library - React Native Paper components
- Color Themes - Theming and dark mode
- Error and Loading Handling - State management
- Splash Screen and App Icon
- Safe Areas
- System Bars
- Fonts
- Assets
- Animation
- Store Data
- Environment Variables
- Expo Documentation
- Expo Router Documentation
- React Native Directory - Search for React Native libraries
- Expo Discord - Community support
MIT License - See LICENSE for more information.