React Native Architecture

作者 wshobson46891e7e60da無授權條款收錄於 2026年10月8日更新於 2026年10月8日

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.

AI 產生的概覽

指導正式環境的 React Native 與 Expo 應用程式架構,涵蓋導覽、原生模組、離線同步與跨平台模式。

功能
此技能為建置正式環境的 React Native 應用程式提供架構指引,內容涵蓋專案結構、Expo 與裸 React Native 的取捨、以 Expo Router 為基礎的導覽設定、狀態管理、原生模組整合、離線優先模式以及效能實務。它也會指向一份參考檔案,其中包含更詳細的模式與完整範例。
適用情境
適合在啟動新的 React Native 或 Expo 專案、設計導覽或狀態管理、整合原生模組與平台 API,或建置離線優先的行動應用程式時使用。在最佳化 React Native 效能或規劃行動版發布流程時也同樣適用。
執行需求
不隨附指令碼,僅為說明文件。需要 React Native 或 Expo 開發環境,包括 Node.js 與 npm/npx,並引用隨附的參考文件以取得更深入的模式。

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

FeatureExpoBare RN
Setup complexityLowHigh
Native modulesEAS BuildManual linking
OTA updatesBuilt-inManual setup
Build serviceEASCustom CI
Custom native codeConfig pluginsDirect access

Quick Start

bash
# Create new Expo projectnpx create-expo-app@latest my-app -t expo-template-blank-typescript
# Install essential dependenciesnpx expo install expo-router expo-status-bar react-native-safe-area-contextnpx expo install @react-native-async-storage/async-storagenpx expo install expo-secure-store expo-haptics
typescript
// app/_layout.tsximport { 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

來源與署名

來源:wshobson/agents位於plugins/frontend-mobile-development/skills/react-native-architecture提交46891e7

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架