react-native-architecture
wshobson/agents
Production React Native patterns with Expo, navigation, native modules, and offline-first architecture.
What is react-native-architecture?
Build scalable React Native apps using Expo, Expo Router for navigation, state management, native module integration, and offline-first patterns. Use this when starting new mobile projects, implementing complex navigation, integrating platform APIs, or architecting production React Native applications.
- Set up Expo projects with TypeScript and essential dependencies
- Implement file-based routing with Expo Router and nested navigation groups
- Integrate native modules and platform APIs via EAS Build and config plugins
- Build offline-first applications with async storage and sync patterns
- Optimize performance with FlashList, memoization, and Reanimated animations
- Structure projects with clear separation of concerns (components, hooks, services, stores)
How to install react-native-architecture
npx skills add https://github.com/wshobson/agents --skill react-native-architecture- Node.js and npm/yarn installed
- Familiarity with React and TypeScript
- Expo CLI (installed via npx)
- iOS Simulator or Android Emulator for testing (or physical device)
How to use react-native-architecture
- 1.Create a new Expo project with TypeScript template using npx create-expo-app
- 2.Install core dependencies: expo-router, async-storage, secure-store, and state management libraries
- 3.Set up root layout with Stack navigation and provider wrappers (Theme, Query, etc.)
- 4.Organize source code into app/, components/, hooks/, services/, stores/, and utils/ directories
- 5.Define navigation structure using Expo Router file-based routing in app/ directory
- 6.Implement feature screens and components following the provided architecture patterns
- 7.Test on both iOS and Android devices to catch platform-specific issues
- 8.Configure EAS Build for CI/CD and OTA updates if using Expo managed service
Use cases
- Starting a new Expo or React Native project with modern tooling
- Implementing tab-based and modal navigation patterns in mobile apps
- Integrating native iOS/Android APIs without ejecting from Expo
- Building offline-capable apps with local storage and background sync
- Optimizing list rendering and animations for 60fps performance
- Mobile app developers building with React Native
- Full-stack developers expanding into mobile platforms
- Teams adopting Expo for faster development cycles
- Developers needing native module integration without bare React Native complexity
react-native-architecture FAQ
Use Expo for faster development, built-in OTA updates, and managed native code. Only switch to bare React Native if you need direct native code access that Expo config plugins cannot provide.
Use EAS Build with config plugins for managed native code, or create custom plugins. For complex integrations, consider ejecting to bare React Native.
Use AsyncStorage or SQLite for local persistence, combine with React Query for sync state management, and implement background sync when connectivity returns.
Replace FlatList with FlashList for better performance, use memoization for components, and implement virtualization for large datasets.
Yes, Expo provides built-in OTA updates. Use EAS Update to push JavaScript changes without app store review, though native code changes still require a new build.
Full instructions (SKILL.md)
Source of truth, from wshobson/agents.
name: react-native-architecture description: Build production React Native apps with Expo, navigation, native modules, offline sync, and cross-platform patterns. Use when developing mobile apps, implementing native integrations, or architecting React Native projects.
React Native Architecture
Production-ready patterns for React Native development with Expo, including navigation, state management, native modules, and offline-first architecture.
When to Use This Skill
- Starting a new React Native or Expo project
- Implementing complex navigation patterns
- Integrating native modules and platform APIs
- Building offline-first mobile applications
- Optimizing React Native performance
- Setting up CI/CD for mobile releases
Core Concepts
1. Project Structure
src/
├── app/ # Expo Router screens
│ ├── (auth)/ # Auth group
│ ├── (tabs)/ # Tab navigation
│ └── _layout.tsx # Root layout
├── components/
│ ├── ui/ # Reusable UI components
│ └── features/ # Feature-specific components
├── hooks/ # Custom hooks
├── services/ # API and native services
├── stores/ # State management
├── utils/ # Utilities
└── types/ # TypeScript types
2. Expo vs Bare React Native
| Feature | Expo | Bare RN |
|---|---|---|
| Setup complexity | Low | High |
| Native modules | EAS Build | Manual linking |
| OTA updates | Built-in | Manual setup |
| Build service | EAS | Custom CI |
| Custom native code | Config plugins | Direct access |
Quick Start
# Create new Expo project
npx create-expo-app@latest my-app -t expo-template-blank-typescript
# Install essential dependencies
npx expo install expo-router expo-status-bar react-native-safe-area-context
npx expo install @react-native-async-storage/async-storage
npx expo install expo-secure-store expo-haptics
// app/_layout.tsx
import { Stack } from 'expo-router'
import { ThemeProvider } from '@/providers/ThemeProvider'
import { QueryProvider } from '@/providers/QueryProvider'
export default function RootLayout() {
return (
<QueryProvider>
<ThemeProvider>
<Stack screenOptions={{ headerShown: false }}>
<Stack.Screen name="(tabs)" />
<Stack.Screen name="(auth)" />
<Stack.Screen name="modal" options={{ presentation: 'modal' }} />
</Stack>
</ThemeProvider>
</QueryProvider>
)
}
Detailed patterns and worked examples
Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.
Best Practices
Do's
- Use Expo - Faster development, OTA updates, managed native code
- FlashList over FlatList - Better performance for long lists
- Memoize components - Prevent unnecessary re-renders
- Use Reanimated - 60fps animations on native thread
- Test on real devices - Simulators miss real-world issues
Don'ts
- Don't inline styles - Use StyleSheet.create for performance
- Don't fetch in render - Use useEffect or React Query
- Don't ignore platform differences - Test on both iOS and Android
- Don't store secrets in code - Use environment variables
- Don't skip error boundaries - Mobile crashes are unforgiving
Related skills
More from wshobson/agents and the wider catalog.
tailwind-design-system
Build production-ready design systems with Tailwind CSS v4, design tokens, and component libraries.
typescript-advanced-types
Master TypeScript's advanced type system: generics, conditional types, mapped types, and utility types for type-safe applications.
nodejs-backend-patterns
Build production-ready Node.js backends with Express/Fastify, middleware patterns, auth, and database integration.
python-performance-optimization
Profile and optimize Python code using cProfile, memory profilers, and performance best practices.
brand-landingpage
Brand-first landing page designer with guided interviews and Stitch-powered iteration.
python-testing-patterns
Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development.