Trigger: Use when developing React Native or Expo applications — component patterns, navigation, state management, and native module integration.
React Native & Expo Development Guide
A practical guide for building production-ready React Native and Expo applications. Covers UI, animations, state, testing, performance, and deployment.
References
Consult these resources as needed:
- references/navigation.md — Expo Router: Stack, Tabs, NativeTabs (
headerLargeTitle, headerBackButtonDisplayMode), links, modals, sheets, context menus
- references/components.md — FlashList patterns,
expo-image, safe areas (contentInsetAdjustmentBehavior), native controls, blur/glass effects, storage
- references/styling.md — StyleSheet, NativeWind/Tailwind, platform styles, theming, dark mode
- references/animations.md — Reanimated 3: entering/exiting, shared values, gestures, scroll-driven
- references/state-management.md — Zustand (selectors, persist), Jotai (atoms, derived), React Query, Context
- references/forms.md — React Hook Form + Zod: validation, multi-step, dynamic arrays
- references/networking.md — fetch wrapper, React Query (optimistic updates), auth tokens, offline, API routes, webhooks
- references/performance.md — Profiling workflow, FlashList +
memo, bundle analysis, TTI, memory leaks, animation perf
- references/testing.md — Jest, React Native Testing Library, E2E with Maestro
- references/native-capabilities.md — Camera, location, permissions (
use*Permissions hooks), haptics, notifications, biometrics
- references/engineering.md — Project layout (
components/ui/, stores/, services/), path aliases, SDK upgrades, EAS build/submit, CI/CD, DOM components
Quick Reference
Component Preferences
| Purpose |
Use |
Instead of |
| Lists |
FlashList (@shopify/flash-list) + memo items |
FlatList (no view recycling) |
| Images |
expo-image |
RN <Image> (no cache, no WebP) |
| Press |
Pressable |
TouchableOpacity (legacy) |
| Audio |
expo-audio |
expo-av (deprecated) |
| Video |
expo-video |
expo-av (deprecated) |
| Animations |
Reanimated 3 |
RN Animated API (limited) |
| Gestures |
Gesture Handler |
PanResponder (legacy) |
| Platform check |
process.env.EXPO_OS |
Platform.OS |
| Context |
React.use() |
React.useContext() (React 18) |
| Safe area scroll |
contentInsetAdjustmentBehavior="automatic" |
<SafeAreaView> |
| SF Symbols |
expo-image with source="sf:name" |
expo-symbols |
Scaling Up
| Situation |
Consider |
| Long lists with scroll jank |
Virtualized list libraries (e.g. FlashList) |
| Want Tailwind-style classes |
NativeWind v4 |
| High-frequency storage reads |
Sync-based storage (e.g. MMKV) |
| New project with Expo |
Expo Router over bare React Navigation |
State Management
| State Type |
Solution |
| Local UI state |
useState / useReducer |
| Shared app state |
Zustand or Jotai |
| Server / async data |
React Query |
| Form state |
React Hook Form + Zod |
Performance Priorities
| Priority |
Issue |
Fix |
| CRITICAL |
Long list jank |
FlashList + memoized items |
| CRITICAL |
Large bundle |
Avoid barrel imports, enable R8 |
| HIGH |
Too many re-renders |
Zustand selectors, React Compiler |
| HIGH |
Slow startup |
Disable bundle compression, native nav |
| MEDIUM |
Animation drops |
Only animate transform/opacity |
New Project Init
# 1. Create project
npx create-expo-app@latest my-app --template blank-typescript
cd my-app
# 2. Install Expo Router + core deps
npx expo install expo-router react-native-safe-area-context react-native-screens
# 3. (Optional) Common extras
npx expo install expo-image react-native-reanimated react-native-gesture-handler
Then configure:
- Set entry point in
package.json: "main": "expo-router/entry"
- Add scheme in
app.json: "scheme": "my-app"
- Delete
App.tsx and index.ts
- Create
app/_layout.tsx as root Stack layout
- Create
app/(tabs)/_layout.tsx for tab navigation
- Create route files in
app/(tabs)/ (see navigation.md)
For web support, also install: npx expo install react-native-web react-dom @expo/metro-runtime
Core Principles
Consult references before writing: when implementing navigation, lists, networking, or project setup, read the matching reference file above for patterns and pitfalls.
Try Expo Go first (npx expo start). Custom builds (eas build) only needed when using local Expo modules, Apple targets, or third-party native modules not in Expo Go.
Conditional rendering: use {count > 0 && <Text />} not {count && <Text />} (renders "0").
Animation rule: only animate transform and opacity — GPU-composited, no layout thrash.
Imports: always import directly from source, not barrel files — avoids bundle bloat.
Lists and images: before using FlatList or RN Image, check the Component Preferences table above — FlashList and expo-image are almost always the right choice.
Route files: always use kebab-case, never co-locate components/types/utils in app/.
Checklist
New Project Setup
Before Shipping
Flutter development → see flutter-dev skill.
iOS native (UIKit/SwiftUI) → see ios-application-dev skill.
Android native (Kotlin/Compose) → see android-native-dev skill.
React Native is a trademark of Meta Platforms, Inc. Expo is a trademark of 650 Industries, Inc. All other product names are trademarks of their respective owners.
1---2name: react-native-dev3description: **Trigger**: Use when developing React Native or Expo applications — component patterns, navigation, state management, and native module integration.4---56**Trigger**: Use when developing React Native or Expo applications — component patterns, navigation, state management, and native module integration.78# React Native & Expo Development Guide910A practical guide for building production-ready React Native and Expo applications. Covers UI, animations, state, testing, performance, and deployment.1112## References1314Consult these resources as needed:1516- [references/navigation.md](references/navigation.md) — Expo Router: Stack, Tabs, NativeTabs (`headerLargeTitle`, `headerBackButtonDisplayMode`), links, modals, sheets, context menus17- [references/components.md](references/components.md) — FlashList patterns, `expo-image`, safe areas (`contentInsetAdjustmentBehavior`), native controls, blur/glass effects, storage18- [references/styling.md](references/styling.md) — StyleSheet, NativeWind/Tailwind, platform styles, theming, dark mode19- [references/animations.md](references/animations.md) — Reanimated 3: entering/exiting, shared values, gestures, scroll-driven20- [references/state-management.md](references/state-management.md) — Zustand (selectors, persist), Jotai (atoms, derived), React Query, Context21- [references/forms.md](references/forms.md) — React Hook Form + Zod: validation, multi-step, dynamic arrays22- [references/networking.md](references/networking.md) — fetch wrapper, React Query (optimistic updates), auth tokens, offline, API routes, webhooks23- [references/performance.md](references/performance.md) — Profiling workflow, FlashList + `memo`, bundle analysis, TTI, memory leaks, animation perf24- [references/testing.md](references/testing.md) — Jest, React Native Testing Library, E2E with Maestro25- [references/native-capabilities.md](references/native-capabilities.md) — Camera, location, permissions (`use*Permissions` hooks), haptics, notifications, biometrics26- [references/engineering.md](references/engineering.md) — Project layout (`components/ui/`, `stores/`, `services/`), path aliases, SDK upgrades, EAS build/submit, CI/CD, DOM components2728## Quick Reference2930### Component Preferences3132| Purpose | Use | Instead of |33|---------|-----|------------|34| Lists | `FlashList` (`@shopify/flash-list`) + `memo` items | `FlatList` (no view recycling) |35| Images | `expo-image` | RN `<Image>` (no cache, no WebP) |36| Press | `Pressable` | `TouchableOpacity` (legacy) |37| Audio | `expo-audio` | `expo-av` (deprecated) |38| Video | `expo-video` | `expo-av` (deprecated) |39| Animations | Reanimated 3 | RN Animated API (limited) |40| Gestures | Gesture Handler | PanResponder (legacy) |41| Platform check | `process.env.EXPO_OS` | `Platform.OS` |42| Context | `React.use()` | `React.useContext()` (React 18) |43| Safe area scroll | `contentInsetAdjustmentBehavior="automatic"` | `<SafeAreaView>` |44| SF Symbols | `expo-image` with `source="sf:name"` | `expo-symbols` |4546### Scaling Up4748| Situation | Consider |49|-----------|----------|50| Long lists with scroll jank | Virtualized list libraries (e.g. FlashList) |51| Want Tailwind-style classes | NativeWind v4 |52| High-frequency storage reads | Sync-based storage (e.g. MMKV) |53| New project with Expo | Expo Router over bare React Navigation |5455### State Management5657| State Type | Solution |58|------------|----------|59| Local UI state | `useState` / `useReducer` |60| Shared app state | Zustand or Jotai |61| Server / async data | React Query |62| Form state | React Hook Form + Zod |6364### Performance Priorities6566| Priority | Issue | Fix |67|----------|-------|-----|68| CRITICAL | Long list jank | `FlashList` + memoized items |69| CRITICAL | Large bundle | Avoid barrel imports, enable R8 |70| HIGH | Too many re-renders | Zustand selectors, React Compiler |71| HIGH | Slow startup | Disable bundle compression, native nav |72| MEDIUM | Animation drops | Only animate `transform`/`opacity` |7374## New Project Init7576```bash77# 1. Create project78npx create-expo-app@latest my-app --template blank-typescript79cd my-app8081# 2. Install Expo Router + core deps82npx expo install expo-router react-native-safe-area-context react-native-screens8384# 3. (Optional) Common extras85npx expo install expo-image react-native-reanimated react-native-gesture-handler86```8788Then configure:89901. Set entry point in `package.json`: `"main": "expo-router/entry"`912. Add scheme in `app.json`: `"scheme": "my-app"`923. Delete `App.tsx` and `index.ts`934. Create `app/_layout.tsx` as root Stack layout945. Create `app/(tabs)/_layout.tsx` for tab navigation956. Create route files in `app/(tabs)/` (see [navigation.md](references/navigation.md))9697For web support, also install: `npx expo install react-native-web react-dom @expo/metro-runtime`9899## Core Principles100101**Consult references before writing**: when implementing navigation, lists, networking, or project setup, read the matching reference file above for patterns and pitfalls.102103**Try Expo Go first** (`npx expo start`). Custom builds (`eas build`) only needed when using local Expo modules, Apple targets, or third-party native modules not in Expo Go.104105**Conditional rendering**: use `{count > 0 && <Text />}` not `{count && <Text />}` (renders "0").106107**Animation rule**: only animate `transform` and `opacity` — GPU-composited, no layout thrash.108109**Imports**: always import directly from source, not barrel files — avoids bundle bloat.110111**Lists and images**: before using `FlatList` or RN `Image`, check the Component Preferences table above — `FlashList` and `expo-image` are almost always the right choice.112113**Route files**: always use kebab-case, never co-locate components/types/utils in `app/`.114115## Checklist116117### New Project Setup118- [ ] `tsconfig.json` path aliases configured119- [ ] `EXPO_PUBLIC_API_URL` env var set per environment120- [ ] Root layout has `GestureHandlerRootView` (if using gestures)121- [ ] `contentInsetAdjustmentBehavior="automatic"` on all scroll views122- [ ] `FlashList` instead of `FlatList` for lists > 20 items123124### Before Shipping125- [ ] Profile in `--profile` mode, fix frames > 16ms126- [ ] Bundle analyzed (`source-map-explorer`), no barrel imports127- [ ] R8 enabled for Android128- [ ] Unit + component tests for critical paths129- [ ] E2E flows for login, core feature, checkout130131---132133Flutter development → see `flutter-dev` skill.134iOS native (UIKit/SwiftUI) → see `ios-application-dev` skill.135Android native (Kotlin/Compose) → see `android-native-dev` skill.136137*React Native is a trademark of Meta Platforms, Inc. Expo is a trademark of 650 Industries, Inc. All other product names are trademarks of their respective owners.*