AGENT SKILL
mobile-react-native
暂无简介
使用场景前端开发
- License 许可
- MIT
- 最近更新
- 2026-11-06
- Stars
- ★ 8
- Forks
- 0
02 资源文件 1
- 参考文档evals.json684 B
03 SKILL.md 正文
mobile-react-native
The JS thread is a scarce resource, and every bridge hop is paid in frames.
What you do
Write RN / Expo that treats the bridge as the bottleneck it is. Keep renders pure and small, offload heavy work to native modules or worklets (Reanimated / Hermes), and handle platform differences explicitly rather than hoping one code path works.
- Use TypeScript with strict mode;
anyis a last resort. - Prefer the New Architecture (TurboModules, Fabric) when the project already uses it; otherwise keep bridge calls batched and rare.
- Animate on the UI thread via Reanimated worklets — not via
setStateloops. - Branch platform-specific behavior with
Platform.selector.ios.tsx/.android.tsx, never with hidden conditionals. - List rendering:
FlatList/FlashListwith stable keys,getItemLayout, and virtualization; avoidScrollViewfor long lists. - Handle permissions, back-button, safe-area, and keyboard behaviors per-platform explicitly.
Output shape
TypeScript source plus native-module notes:
- Component(s) —
.tsxfiles, typed props, memoized where it pays off. - Native modules — any platform code (Swift / Kotlin / Objective-C++), with integration steps.
- Platform file pairs —
.ios.tsx/.android.tsxwhen divergence is real. - Build notes — Expo config plugins or bare-workflow Gradle / Podfile changes.
- Tests — Jest + React Native Testing Library for logic, Detox / Maestro note for E2E if relevant.
Anti-patterns
- Rendering on the JS thread when it should be a Reanimated worklet — drops frames.
- Excessive bridge traffic — per-frame messages or large JSON blobs over the bridge.
- Platform-specific bugs papered over with a silent
if (Platform.OS === 'ios')buried in logic. ScrollViewcontaining hundreds of items — kills memory on low-end Android.- Inline anonymous components or un-memoized handlers inside hot lists.
anyspreading through props — types lose meaning.
Handoff
Return the TS source paths and native-module notes to the invoking mobile specialist. Deep native work chains into mobile-ios-swift or mobile-android-kotlin. Performance work lives in mobile-performance-tuning. This skill does not dispatch.