Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计通过

react-nativeReact Native 开发

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

14,256

周安装

594

GitHub Stars

750

下载量

4,752
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:react-native(React Native 开发)
来源仓库:https://github.com/jezweb/claude-skills
仓库路径:skills/react-native
安装命令:
npx skills add https://github.com/jezweb/claude-skills --skill react-native
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/jezweb/claude-skills --skill react-native

简介

用于辅助前端页面、组件和样式开发与维护。

  • 适合生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码。
  • 需结合项目现有设计系统和路由方式,避免生成孤立片段。
  • 涉及页面改动时,应配合本地预览和构建检查确认视觉效果。
  • react-native 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

React Native Patterns

Performance and architecture patterns for React Native + Expo apps. Rules ranked by impact — fix CRITICAL before touching MEDIUM.

This is a starting point. The skill will grow as you build more mobile apps.

When to Apply

  • Building new React Native or Expo apps
  • Optimising list and scroll performance
  • Implementing animations
  • Reviewing mobile code for performance issues
  • Setting up a new Expo project

1. List Performance (CRITICAL)

Lists are the #1 performance issue in React Native. A janky scroll kills the entire app experience.

PatternProblemFix
ScrollView for data<ScrollView> renders all items at onceUse <FlatList> or <FlashList> — virtualised, only renders visible items
Missing keyExtractorFlatList without keyExtractor → unnecessary re-renderskeyExtractor={(item) => item.id} — stable unique key per item
Complex renderItemExpensive component in renderItem re-renders on every scrollWrap in React.memo, extract to separate component
Inline functions in renderItemrenderItem={({item}) => <Row onPress={() => nav(item.id)} />}Extract handler: const handlePress = useCallback(...)
No getItemLayoutFlatList measures every item on scroll (expensive)Provide getItemLayout for fixed-height items: (data, index) => ({length: 80, offset: 80 * index, index})
FlashListFlatList is good, FlashList is better for large lists@shopify/flash-list — drop-in replacement, recycling architecture
Large images in listsFull-res images decoded on main threadUse expo-image with placeholder + transition, specify dimensions

FlatList Checklist

Every FlatList should have:

<FlatList
  data={items}
  keyExtractor={(item) => item.id}
  renderItem={renderItem}           // Memoised component
  getItemLayout={getItemLayout}     // If items are fixed height
  initialNumToRender={10}           // Don't render 100 items on mount
  maxToRenderPerBatch={10}          // Batch size for off-screen rendering
  windowSize={5}                    // How many screens to keep in memory
  removeClippedSubviews={true}      // Unmount off-screen items (Android)
/>

2. Animations (HIGH)

Native animations run on the UI thread. JS animations block the JS thread and cause jank.

PatternProblemFix
Animated API for complex animationsAnimated runs on JS thread, blocks interactionsUse react-native-reanimated — runs on UI thread
Layout animationItem appears/disappears with no transitionLayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
Shared element transitionsNavigate between screens, element teleportsreact-native-reanimated shared transitions or expo-router shared elements
Gesture + animationDrag/swipe feels laggyreact-native-gesture-handler + reanimated worklets — all on UI thread
Measuring layoutonLayout fires too late, causes flashUse useAnimatedStyle with shared values for instant response

Reanimated Basics

import Animated, { useSharedValue, useAnimatedStyle, withSpring } from 'react-native-reanimated';

function AnimatedBox() {
  const offset = useSharedValue(0);
  const style = useAnimatedStyle(() => ({
    transform: [{ translateX: withSpring(offset.value) }],
  }));

  return (
    <GestureDetector gesture={panGesture}>
      <Animated.View style={[styles.box, style]} />
    </GestureDetector>
  );
}

3. Navigation (HIGH)

PatternProblemFix
Expo RouterFile-based routing (like Next.js) for React Nativeapp/ directory with _layout.tsx files. Preferred for new Expo projects.
Heavy screens on stackEvery screen stays mounted in the stackUse unmountOnBlur: true for screens that don't need to persist
Deep linkingApp doesn't respond to URLsExpo Router handles this automatically. For bare RN: Linking API config
Tab badge updatesBadge count doesn't update when tab is focusedUse useIsFocused() or refetch on focus: useFocusEffect(useCallback(...))
Navigation state persistenceApp loses position on background/killonStateChange + initialState with AsyncStorage

Expo Router Structure

app/
├── _layout.tsx          # Root layout (tab navigator)
├── index.tsx            # Home tab
├── (tabs)/
│   ├── _layout.tsx      # Tab bar config
│   ├── home.tsx
│   ├── search.tsx
│   └── profile.tsx
├── [id].tsx             # Dynamic route
└── modal.tsx            # Modal route

4. UI Patterns (HIGH)

PatternProblemFix
Safe areaContent under notch or home indicator<SafeAreaView> or useSafeAreaInsets() from react-native-safe-area-context
Keyboard avoidanceForm fields hidden behind keyboard<KeyboardAvoidingView behavior={Platform.OS === 'ios'? 'padding': 'height'}>
Platform-specific codeiOS and Android need different behaviourPlatform.select({ios:..., android:...}) or .ios.tsx / .android.tsx files
Status barStatus bar overlaps content or wrong colour<StatusBar style="auto" /> from expo-status-bar in root layout
Touch targetsButtons too small to tapMinimum 44x44pt. Use hitSlop={{top: 10, bottom: 10, left: 10, right: 10}}
Haptic feedbackTaps feel deadexpo-hapticsHaptics.impactAsync(Haptics.ImpactFeedbackStyle.Light) on important actions

5. Images and Media (MEDIUM)

PatternProblemFix
Image component<Image> from react-native is basicUse expo-image — caching, placeholder, transition, blurhash
Remote images without dimensionsLayout shift when image loadsAlways specify width and height, or use aspectRatio
Large imagesOOM crashes on AndroidResize server-side or use expo-image which handles memory
SVGSVG support isn't nativereact-native-svg + react-native-svg-transformer for SVG imports
VideoVideo playbackexpo-av or expo-video (newer API)

6. State and Data (MEDIUM)

PatternProblemFix
AsyncStorage for complex dataJSON parse/stringify on every readUse MMKV (react-native-mmkv) — 30x faster than AsyncStorage
Global stateRedux/MobX boilerplate for simple stateZustand — minimal, works great with React Native
Server stateManual fetch + loading + error + cacheTanStack Query — same as web, works in React Native
Offline firstApp unusable without networkTanStack Query persistQueryClient + MMKV, or WatermelonDB for complex offline
Deep state updatesSpread operator hell for nested objectsImmer via Zustand: set(produce(state => {state.user.name = 'new'}))

7. Expo Workflow (MEDIUM)

PatternWhenHow
Development buildNeed native modulesnpx expo run:ios or eas build --profile development
Expo GoQuick prototyping, no native modulesnpx expo start — scan QR code
EAS BuildCI/CD, app store buildseas build --platform ios --profile production
EAS UpdateHot fix without app store revieweas update --branch production --message "Fix bug"
Config pluginsModify native config without ejectingapp.config.ts with expo-build-properties or custom config plugin
Environment variablesDifferent configs per buildeas.json build profiles + expo-constants

New Project Setup

npx create-expo-app my-app --template tabs
cd my-app
npx expo install expo-image react-native-reanimated react-native-gesture-handler react-native-safe-area-context

8. Testing (LOW-MEDIUM)

ToolForSetup
JestUnit tests, hook testsIncluded with Expo by default
React Native Testing LibraryComponent tests@testing-library/react-native
DetoxE2E tests on real devices/simulatorsdetox — Wix's testing framework
MaestroE2E with YAML flowsmaestro test flow.yaml — simpler than Detox

Common Gotchas

GotchaFix
Metro bundler cachenpx expo start --clear
Pod install issues (iOS)cd ios && pod install --repo-update
Reanimated not workingMust be first import: import 'react-native-reanimated' in root
Expo SDK upgradenpx expo install --fix after updating SDK version
Android build failsCheck gradle.properties for memory: org.gradle.jvmargs=-Xmx4g
iOS simulator slowUse physical device for performance testing — simulator doesn't reflect real perf

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.67%
按下载量换算1,695

Claude

33.37%
按下载量换算1,586

Cursor

17.77%
按下载量换算844

Gemini CLI

9.16%
按下载量换算435

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills