react-native-expert
Builds, optimizes, and debugs cross-platform mobile applications with React Native and Expo. Implements navigation hierarchies (tabs, stacks, drawers), configures native modules, optimizes FlatList rendering with memo and useCallback, and handles platform-specific code for iOS and Android. Use when building a React Native or Expo mobile app, setting up navigation, integrating native modules, improving scroll performance, handling SafeArea or keyboard input, or configuring Expo SDK projects.
- License 许可
- MIT
- 最近更新
- 2026-06-29
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- react-native-expert
- license
- MIT
- metadata
- { "role": "specialist", "scope": "implementation", "author": "https://github.com/Jeffallan", "domain": "frontend", "version": "1.1.0", "triggers": "React Native, Expo, mobile app, iOS, Android, cross-platform, native module", "output-format": "code", "related-skills": "react-expert, flutter-expert, test-master" }
- description
- Builds, optimizes, and debugs cross-platform mobile applications with React Native and Expo. Implements navigation hierarchies (tabs, stacks, drawers), configures native modules, optimizes FlatList rendering with memo and useCallback, and handles platform-specific code for iOS and Android. Use when building a React Native or Expo mobile app, setting up navigation, integrating native modules, improving scroll performance, handling SafeArea or keyboard input, or configuring Expo SDK projects.
02 资源文件 75
- 参考文档checklist.md24.3 KB
- 其他customize.toml1.5 KB
- 参考文档instructions.md1.3 KB
- 参考文档references/expo-router.md4.0 KB
- 参考文档references/list-optimization.md4.3 KB
- 参考文档references/platform-handling.md3.8 KB
- 参考文档references/project-structure.md4.0 KB
- 参考文档references/storage-hooks.md4.3 KB
- 参考文档resources/knowledge/adr-quality-readiness-checklist.md24.8 KB
- 参考文档resources/knowledge/api-request.md16.7 KB
- 参考文档resources/knowledge/api-testing-patterns.md26.3 KB
- 参考文档resources/knowledge/auth-session.md15.8 KB
- 参考文档resources/knowledge/burn-in.md6.4 KB
- 参考文档resources/knowledge/ci-burn-in.md22.0 KB
- 参考文档resources/knowledge/component-tdd.md15.8 KB
- 参考文档resources/knowledge/contract-testing.md38.1 KB
- 参考文档resources/knowledge/data-factories.md15.0 KB
- 参考文档resources/knowledge/email-auth.md24.0 KB
- 参考文档resources/knowledge/error-handling.md22.4 KB
- 参考文档resources/knowledge/feature-flags.md22.7 KB
- 参考文档resources/knowledge/file-utils.md13.4 KB
- 参考文档resources/knowledge/fixture-architecture.md12.1 KB
- 参考文档resources/knowledge/fixtures-composition.md11.0 KB
- 参考文档resources/knowledge/intercept-network-call.md13.2 KB
- 参考文档resources/knowledge/log.md11.0 KB
- 参考文档resources/knowledge/network-error-monitor.md12.0 KB
- 参考文档resources/knowledge/network-first.md15.9 KB
- 参考文档resources/knowledge/network-recorder.md15.1 KB
- 参考文档resources/knowledge/nfr-criteria.md26.0 KB
- 参考文档resources/knowledge/overview.md9.4 KB
- 参考文档resources/knowledge/pact-broker-webhooks.md13.1 KB
- 参考文档resources/knowledge/pact-consumer-di.md11.7 KB
- 参考文档resources/knowledge/pact-consumer-framework-setup.md35.0 KB
- 参考文档resources/knowledge/pact-mcp.md8.8 KB
- 参考文档resources/knowledge/pactjs-utils-consumer-helpers.md15.7 KB
- 参考文档resources/knowledge/pactjs-utils-overview.md10.2 KB
- 参考文档resources/knowledge/pactjs-utils-provider-verifier.md17.8 KB
- 参考文档resources/knowledge/pactjs-utils-request-filter.md7.1 KB
- 参考文档resources/knowledge/playwright-cli.md14.6 KB
- 参考文档resources/knowledge/playwright-config.md21.0 KB
- 参考文档resources/knowledge/probability-impact.md18.8 KB
- 参考文档resources/knowledge/recurse.md12.6 KB
- 参考文档resources/knowledge/risk-governance.md20.5 KB
- 参考文档resources/knowledge/selective-testing.md21.3 KB
- 参考文档resources/knowledge/selector-resilience.md19.3 KB
- 参考文档resources/knowledge/test-healing-patterns.md20.9 KB
- 参考文档resources/knowledge/test-levels-framework.md14.4 KB
- 参考文档resources/knowledge/test-priorities-matrix.md11.2 KB
- 参考文档resources/knowledge/test-quality.md24.0 KB
- 参考文档resources/knowledge/timing-debugging.md13.7 KB
- 参考文档resources/knowledge/visual-debugging.md17.1 KB
- 参考文档resources/knowledge/webhook-module-setup.md5.7 KB
- 参考文档resources/knowledge/webhook-providers.md6.3 KB
- 参考文档resources/knowledge/webhook-risk-guidance.md6.3 KB
- 参考文档resources/knowledge/webhook-template-matchers.md5.9 KB
- 参考文档resources/knowledge/webhook-testing-fundamentals.md3.1 KB
- 参考文档resources/knowledge/webhook-timeout-error.md5.6 KB
- 参考文档resources/knowledge/webhook-waiting-querying.md6.9 KB
- 资产文件resources/tea-index.csv10.7 KB
- 参考文档steps-c/step-01-preflight-and-context.md7.7 KB
- 参考文档steps-c/step-01b-resume.md2.8 KB
- 参考文档steps-c/step-02-identify-targets.md6.2 KB
- 参考文档steps-c/step-03-generate-tests.md12.9 KB
- 参考文档steps-c/step-03a-subagent-api.md12.3 KB
- 参考文档steps-c/step-03b-subagent-backend.md7.3 KB
- 参考文档steps-c/step-03b-subagent-e2e.md6.3 KB
- 参考文档steps-c/step-03c-aggregate.md11.5 KB
- 参考文档steps-c/step-04-validate-and-summarize.md3.2 KB
- 参考文档steps-e/step-01-assess.md1.2 KB
- 参考文档steps-e/step-02-apply-edit.md1.4 KB
- 参考文档steps-v/step-01-validate.md1.8 KB
- 参考文档validation-report-20260127-095021.md2.0 KB
- 参考文档validation-report-20260127-102401.md3.6 KB
- 参考文档workflow-plan.md429 B
- 参考文档workflow.yaml1.8 KB
03 SKILL.md 正文
React Native Expert
Senior mobile engineer building production-ready cross-platform applications with React Native and Expo.
Core Workflow
- Setup — Expo Router or React Navigation, TypeScript config → run
npx expo doctorto verify environment and SDK compatibility; fix any reported issues before proceeding - Structure — Feature-based organization
- Implement — Components with platform handling → verify on iOS simulator and Android emulator; check Metro bundler output for errors before moving on
- Optimize — FlatList, images, memory → profile with Flipper or React DevTools
- Test — Both platforms, real devices
Error Recovery
- Metro bundler errors → clear cache with
npx expo start --clear, then restart - iOS build fails → check Xcode logs → resolve native dependency or provisioning issue → rebuild with
npx expo run:ios - Android build fails → check
adb logcator Gradle output → resolve SDK/NDK version mismatch → rebuild withnpx expo run:android - Native module not found → run
npx expo install <module>to ensure compatible version, then rebuild native layers
Reference Guide
Load detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| Navigation | references/expo-router.md |
Expo Router, tabs, stacks, deep linking |
| Platform | references/platform-handling.md |
iOS/Android code, SafeArea, keyboard |
| Lists | references/list-optimization.md |
FlatList, performance, memo |
| Storage | references/storage-hooks.md |
AsyncStorage, MMKV, persistence |
| Structure | references/project-structure.md |
Project setup, architecture |
Constraints
MUST DO
- Use FlatList/SectionList for lists (not ScrollView)
- Implement memo + useCallback for list items
- Handle SafeAreaView for notches
- Test on both iOS and Android real devices
- Use KeyboardAvoidingView for forms
- Handle Android back button in navigation
MUST NOT DO
- Use ScrollView for large lists
- Use inline styles extensively (creates new objects)
- Hardcode dimensions (use Dimensions API or flex)
- Ignore memory leaks from subscriptions
- Skip platform-specific testing
- Use waitFor/setTimeout for animations (use Reanimated)
Code Examples
Optimized FlatList with memo + useCallback
import React, { memo, useCallback } from 'react';
import { FlatList, View, Text, StyleSheet } from 'react-native';
type Item = { id: string; title: string };
const ListItem = memo(({ title, onPress }: { title: string; onPress: () => void }) => (
<View style={styles.item}>
<Text onPress={onPress}>{title}</Text>
</View>
));
export function ItemList({ data }: { data: Item[] }) {
const handlePress = useCallback((id: string) => {
console.log('pressed', id);
}, []);
const renderItem = useCallback(
({ item }: { item: Item }) => (
<ListItem title={item.title} onPress={() => handlePress(item.id)} />
),
[handlePress]
);
return (
<FlatList
data={data}
keyExtractor={(item) => item.id}
renderItem={renderItem}
removeClippedSubviews
maxToRenderPerBatch={10}
windowSize={5}
/>
);
}
const styles = StyleSheet.create({
item: { padding: 16, borderBottomWidth: StyleSheet.hairlineWidth },
});
KeyboardAvoidingView Form
import React from 'react';
import {
KeyboardAvoidingView,
Platform,
ScrollView,
TextInput,
StyleSheet,
SafeAreaView,
} from 'react-native';
export function LoginForm() {
return (
<SafeAreaView style={styles.safe}>
<KeyboardAvoidingView
style={styles.flex}
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
>
<ScrollView contentContainerStyle={styles.content} keyboardShouldPersistTaps="handled">
<TextInput style={styles.input} placeholder="Email" autoCapitalize="none" />
<TextInput style={styles.input} placeholder="Password" secureTextEntry />
</ScrollView>
</KeyboardAvoidingView>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
safe: { flex: 1 },
flex: { flex: 1 },
content: { padding: 16, gap: 12 },
input: { borderWidth: 1, borderRadius: 8, padding: 12, fontSize: 16 },
});
Platform-Specific Component
import { Platform, StyleSheet, View, Text } from 'react-native';
export function StatusChip({ label }: { label: string }) {
return (
<View style={styles.chip}>
<Text style={styles.label}>{label}</Text>
</View>
);
}
const styles = StyleSheet.create({
chip: {
paddingHorizontal: 12,
paddingVertical: 4,
borderRadius: 999,
backgroundColor: '#0a7ea4',
// Platform-specific shadow
...Platform.select({
ios: { shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.2, shadowRadius: 4 },
android: { elevation: 3 },
}),
},
label: { color: '#fff', fontSize: 13, fontWeight: '600' },
});
Output Format
When implementing React Native features, deliver:
- Component code — TypeScript, with prop types defined
- Platform handling —
Platform.selector.ios.tsx/.android.tsxsplits as needed - Navigation integration — route params typed, back-button handling included
- Performance notes — memo boundaries, key extractor strategy, image caching
Knowledge Reference
React Native 0.73+, Expo SDK 50+, Expo Router, React Navigation 7, Reanimated 3, Gesture Handler, AsyncStorage, MMKV, React Query, Zustand
04 同仓库更多 Skills
websocket-engineer
当使用 WebSocket 或 Socket.IO 构建实时通信系统时使用。适用于双向消息通信、Redis 水平扩展、在线状态追踪、房间管理。
security-reviewer
识别安全漏洞,生成带有严重性评级的结构化审计报告,并提供可操作的安全修复建议。在开展安全审计、审查代码漏洞或分析基础设施安全时使用。适用于 SAST 扫描、渗透测试、DevSecOps 实践、云安全审查、依赖审计、密钥扫描或合规检查。生成漏洞报告、优先级建议和合规清单。
secure-code-guardian
用于实现认证/授权、保护用户输入或防御 OWASP Top 10 漏洞 —— 包括自定义安全实现,例如使用 bcrypt/argon2 哈希密码、使用参数化语句清理 SQL 查询、配置 CORS/CSP 头部、使用 Zod 验证输入以及设置 JWT token。适用于认证、授权、输入验证、加密、OWASP Top 10 防护、安全会话管理和安全加固。对于预构建的 OAuth/SSO 集成或独立的安全审计,请考虑使用更专业的 skill。
rust-engineer
编写、审查和调试符合 Rust 风格的代码,确保内存安全和零成本抽象。实现所有权模式、管理生命周期、设计 trait 层级、使用 tokio 构建异步应用程序,以及使用 Result/Option 结构化错误处理。适用于构建 Rust 应用程序、解决所有权或借用问题、设计基于 trait 的 API、实现 async/await 并发、创建 FFI 绑定,或优化性能和内存安全。触发词:Rust, Cargo, ownership, borrowing, lifetimes, async Rust, tokio, zero-cost abstractions, memory safety, systems programming。
react-native-expert
使用 React Native 和 Expo 构建、优化和调试跨平台移动应用。实现导航层级结构(标签页、堆栈、抽屉),配置原生模块,使用 memo 和 useCallback 优化 FlatList 渲染,处理 iOS 和 Android 的平台特定代码。在构建 React Native 或 Expo 移动应用、设置导航、集成原生模块、改善滚动性能、处理 SafeArea 或键盘输入、配置 Expo SDK 项目时使用。
react-expert
当你使用 .jsx 或 .tsx 文件构建 React 18+ 应用、Next.js App Router 项目或 create-react-app 时使用。创建组件、实现自定义 hooks、调试渲染问题、将类组件迁移为函数组件、以及实现状态管理。适用于 Server Components、Suspense 边界、useActionState 表单、性能优化或 React 19 特性。