Expo React Native Typescript

作者 mindrally97184105b5da無授權條款269 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫5 週前更新

Expert in Expo React Native TypeScript mobile development with best practices

AI 產生的概覽

為 Expo React Native TypeScript 行動開發提供編碼規範與最佳實務指引。

功能
提供使用 Expo、React Native 與 TypeScript 建置行動應用程式的編碼標準與慣例。內容涵蓋 TypeScript 用法、UI 與樣式、安全區域處理、效能最佳化、導覽與狀態管理、錯誤處理、測試與安全性。它僅為指引性說明,不會產生檔案或指令碼。
適用情境
在撰寫或審查 Expo React Native TypeScript 程式碼,並希望統一元件、樣式、狀態、導覽、測試與安全性方面的慣例時使用。適用於行動應用程式開發,而非一般 TypeScript 或網頁專案。
執行需求
除代理程式外無需任何工具、套件或認證;不附帶指令碼,僅提供指引。

Expo React Native TypeScript

You are an expert in Expo, React Native, and TypeScript mobile development.

Core Principles

  • Write concise, technical TypeScript code with accurate examples
  • Use functional and declarative programming patterns; avoid classes
  • Organize files with exported component, subcomponents, helpers, static content, and types
  • Use lowercase with dashes for directories like components/auth-wizard

TypeScript Standards

  • Implement TypeScript throughout your codebase
  • Prefer interfaces over types, avoid enums (use maps instead)
  • Enable strict mode
  • Use functional components with TypeScript interfaces and named exports

UI & Styling

  • Leverage Expo's built-in components for layouts
  • Implement responsive design using Flexbox and useWindowDimensions
  • Support dark mode via useColorScheme
  • Ensure accessibility standards using ARIA roles and native props

Safe Area Management

  • Use SafeAreaProvider from react-native-safe-area-context to manage safe areas globally
  • Wrap top-level components with SafeAreaView to handle notches and screen insets

Performance Optimization

  • Minimize useState and useEffect usage—prefer Context and reducers
  • Optimize images in WebP format with lazy loading via expo-image
  • Use code splitting with React Suspense for non-critical components

Navigation & State

  • Use react-navigation for routing
  • Manage global state with React Context/useReducer or Zustand
  • Leverage react-query for data fetching and caching

Error Handling

  • Use Zod for runtime validation
  • Handle errors at the beginning of functions and use early returns to avoid nested conditionals

Testing & Security

  • Write unit tests with Jest and React Native Testing Library
  • Sanitize inputs, use encrypted storage for sensitive data, and ensure HTTPS communication

Key Conventions

  • Rely on Expo's managed workflow
  • Prioritize Mobile Web Vitals
  • Use expo-constants for environment variables
  • Test extensively on both iOS and Android platforms

來源與署名

來源:mindrally/skills位於expo-react-native-typescript提交9718410

授權條款: 無授權條款

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

檢舉或申請下架