Expo React Native Performance

作者 pproencacf93c57cac89无许可证215 个星标收录于 2026年10月8日更新于 2026年10月8日仓库7周前更新

Expo React Native performance optimization guidelines. This skill should be used when writing, reviewing, or refactoring Expo React Native code to ensure optimal performance patterns. Triggers on tasks involving React Native components, lists, animations, images, or performance improvements.

AI 生成的概览

针对 Expo React Native 应用的性能优化指南,涵盖启动、列表、重渲染、动画、资源、内存与异步。

功能
该技能提供一套按优先级排列的 42 条 Expo React Native 性能规则,分为八个类别,包括应用启动与包体积、列表虚拟化、重渲染优化、动画性能、图片与资源加载、内存管理、异步数据获取以及平台优化。每条规则都有单独的参考文件,包含说明和代码示例,另有一份汇总全部规则的完整指南。它用于指导 React Native 代码的编写、审查和重构,以采用更优的性能模式。
适用场景
适用于编写新的 React Native 组件或页面、使用 FlatList 或 FlashList 实现列表、添加动画或过渡、优化图片与资源加载,或审查代码中的性能问题时。
运行要求
不含脚本,仅为说明文档和参考文件。代理无需额外工具、软件包或凭据。

Expo React Native Performance Best Practices

Comprehensive performance optimization guide for Expo React Native applications. Contains 42 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

  • Writing new React Native components or screens
  • Implementing lists with FlatList or FlashList
  • Adding animations or transitions
  • Optimizing images and asset loading
  • Reviewing code for performance issues

Rule Categories by Priority

PriorityCategoryImpactPrefix
1App Startup & Bundle SizeCRITICALstartup-
2List VirtualizationCRITICALlist-
3Re-render OptimizationHIGHrerender-
4Animation PerformanceHIGHanim-
5Image & Asset LoadingMEDIUM-HIGHasset-
6Memory ManagementMEDIUMmem-
7Async & Data FetchingMEDIUMasync-
8Platform OptimizationsLOW-MEDIUMplatform-

Quick Reference

1. App Startup & Bundle Size (CRITICAL)

  • startup-enable-hermes [blocked] - Enable Hermes JavaScript engine
  • startup-remove-console-logs [blocked] - Remove console logs in production
  • startup-splash-screen-control [blocked] - Control splash screen visibility
  • startup-preload-assets [blocked] - Preload critical assets during splash
  • startup-async-routes [blocked] - Use async routes for code splitting
  • startup-cherry-pick-imports [blocked] - Use direct imports instead of barrel files

2. List Virtualization (CRITICAL)

  • list-use-flashlist [blocked] - Use FlashList instead of FlatList
  • list-estimated-item-size [blocked] - Provide accurate estimatedItemSize
  • list-get-item-type [blocked] - Use getItemType for mixed lists
  • list-stable-render-item [blocked] - Stabilize renderItem with useCallback
  • list-get-item-layout [blocked] - Provide getItemLayout for fixed heights
  • list-memoize-items [blocked] - Memoize list item components

3. Re-render Optimization (HIGH)

  • rerender-use-memo-expensive [blocked] - Memoize expensive computations
  • rerender-use-callback-handlers [blocked] - Stabilize callbacks with useCallback
  • rerender-functional-setstate [blocked] - Use functional setState updates
  • rerender-lazy-state-init [blocked] - Use lazy state initialization
  • rerender-split-context [blocked] - Split context by update frequency
  • rerender-derive-state [blocked] - Derive state instead of syncing

4. Animation Performance (HIGH)

  • anim-use-native-driver [blocked] - Enable native driver for animations
  • anim-use-reanimated [blocked] - Use Reanimated for complex animations
  • anim-layout-animation [blocked] - Use LayoutAnimation for simple transitions
  • anim-transform-not-dimensions [blocked] - Animate transform instead of dimensions
  • anim-interaction-manager [blocked] - Defer heavy work during animations

5. Image & Asset Loading (MEDIUM-HIGH)

  • asset-use-expo-image [blocked] - Use expo-image for image loading
  • asset-prefetch-images [blocked] - Prefetch images before display
  • asset-optimize-image-size [blocked] - Request appropriately sized images
  • asset-use-webp-format [blocked] - Use WebP format for images
  • asset-recycling-key [blocked] - Use recyclingKey in FlashList images

6. Memory Management (MEDIUM)

  • mem-cleanup-subscriptions [blocked] - Clean up subscriptions in useEffect
  • mem-clear-timers [blocked] - Clear timers on unmount
  • mem-abort-fetch [blocked] - Abort fetch requests on unmount
  • mem-avoid-inline-objects [blocked] - Avoid inline objects in props
  • mem-limit-list-data [blocked] - Limit list data in memory

7. Async & Data Fetching (MEDIUM)

  • async-parallel-fetching [blocked] - Fetch independent data in parallel
  • async-defer-await [blocked] - Defer await until value needed
  • async-batch-api-calls [blocked] - Batch related API calls
  • async-cache-responses [blocked] - Cache API responses locally
  • async-refetch-on-focus [blocked] - Refetch data on screen focus

8. Platform Optimizations (LOW-MEDIUM)

  • platform-android-overdraw [blocked] - Reduce Android overdraw
  • platform-ios-text-rendering [blocked] - Optimize iOS text rendering
  • platform-android-proguard [blocked] - Enable ProGuard for Android release
  • platform-conditional-render [blocked] - Platform-specific optimizations

How to Use

Read individual reference files for detailed explanations and code examples:

  • Section definitions [blocked] - Category structure and impact levels
  • Rule template [blocked] - Template for adding new rules

Full Compiled Document

For the complete guide with all rules expanded, see AGENTS.md [blocked].

Reference Files

FileDescription
AGENTS.md [blocked]Complete compiled guide with all rules
references/_sections.md [blocked]Category definitions and ordering
assets/templates/_template.md [blocked]Template for new rules
metadata.json [blocked]Version and reference information

来源与署名

来源:pproenca/dot-skills位于skills/.experimental/expo-react-native-performance提交cf93c57

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架