Agent SkillsMiniMax-AI/skills › react-native-dev

react-native-dev

GitHub

React Native与Expo应用开发指南,涵盖组件、样式、动画、状态管理、网络、性能优化及原生能力。提供工程规范、测试策略、SDK升级与CI/CD部署等生产级最佳实践参考。

skills/react-native-dev/SKILL.md MiniMax-AI/skills

触发场景

构建或维护React Native/Expo应用 实现复杂UI、动画或原生功能集成 进行性能优化或编写自动化测试 配置CI/CD流水线或执行应用发布

安装

npx skills add MiniMax-AI/skills --skill react-native-dev -g -y
更多选项

不安装直接使用

npx skills use MiniMax-AI/skills@react-native-dev

指定 Agent (Claude Code)

npx skills add MiniMax-AI/skills --skill react-native-dev -a claude-code -g -y

安装 repo 全部 skill

npx skills add MiniMax-AI/skills --all -g -y

预览 repo 内 skill

npx skills add MiniMax-AI/skills --list

SKILL.md

Frontmatter
{
    "name": "react-native-dev",
    "license": "MIT",
    "metadata": {
        "sources": [
            "expo\/skills by Expo (https:\/\/github.com\/expo\/skills) — Native UI, navigation, and animation patterns",
            "Expo documentation (docs.expo.dev)",
            "React Native documentation (reactnative.dev)",
            "EAS (Expo Application Services) documentation"
        ],
        "version": "1.0.0",
        "category": "mobile"
    },
    "description": "React Native and Expo development guide covering components, styling, animations, navigation,\nstate management, forms, networking, performance optimization, testing, native capabilities,\nand engineering (project structure, deployment, SDK upgrades, CI\/CD).\nUse when: building React Native or Expo apps, implementing animations or native UI, managing\nstate, fetching data, writing tests, optimizing performance, deploying to App Store\/Play Store,\nsetting up CI\/CD, upgrading Expo SDK, or configuring Tailwind\/NativeWind.\n"
}

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:

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:

  1. Set entry point in package.json: "main": "expo-router/entry"
  2. Add scheme in app.json: "scheme": "my-app"
  3. Delete App.tsx and index.ts
  4. Create app/_layout.tsx as root Stack layout
  5. Create app/(tabs)/_layout.tsx for tab navigation
  6. 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

  • tsconfig.json path aliases configured
  • EXPO_PUBLIC_API_URL env var set per environment
  • Root layout has GestureHandlerRootView (if using gestures)
  • contentInsetAdjustmentBehavior="automatic" on all scroll views
  • FlashList instead of FlatList for lists > 20 items

Before Shipping

  • Profile in --profile mode, fix frames > 16ms
  • Bundle analyzed (source-map-explorer), no barrel imports
  • R8 enabled for Android
  • Unit + component tests for critical paths
  • E2E flows for login, core feature, checkout

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.

版本历史

  • 60aaae5 当前 2026-07-25 09:04

同 Skill 集合

.claude/skills/pr-review/SKILL.md
plugins/pptx-plugin/skills/color-font-skill/SKILL.md
plugins/pptx-plugin/skills/design-style-skill/SKILL.md
plugins/pptx-plugin/skills/ppt-editing-skill/SKILL.md
plugins/pptx-plugin/skills/ppt-orchestra-skill/SKILL.md
plugins/pptx-plugin/skills/slide-making-skill/SKILL.md
skills/android-native-dev/SKILL.md
skills/buddy-sings/SKILL.md
skills/flutter-dev/SKILL.md
skills/frontend-dev/SKILL.md
skills/gif-sticker-maker/SKILL.md
skills/minimax-multimodal-toolkit/SKILL.md
skills/minimax-music-gen/SKILL.md
skills/minimax-music-playlist/SKILL.md
skills/pptx-generator/SKILL.md
skills/shader-dev/SKILL.md
skills/fullstack-dev/SKILL.md
skills/ios-application-dev/SKILL.md
skills/minimax-docx/SKILL.md
skills/minimax-pdf/SKILL.md
skills/minimax-xlsx/SKILL.md
skills/vision-analysis/SKILL.md

元信息

文件数
0
版本
60aaae5
Hash
6e16a6c9
收录时间
2026-07-25 09:04

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-29 03:16
浙ICP备14020137号-1 $访客地图$