当前位置: 首页 > Skill >

OpenHarmony React Native Performance

OpenHarmony React Native Performance

1.0.0 2026.11.25 浏览:520
获取Skill文件查看使用说明
作者:顾辰许可证:
本文目录展开

OpenHarmony React Native Performance Static Check Skills

Static-check rules and config for React Native for OpenHarmony, from the official performance-optimization doc. This skill is English-only to reduce token usage; Chinese content is available via links below.

When to Apply

Use this skill when:

  • Writing or reviewing React Native for OpenHarmony (RNOH) application code or OpenHarmony project configuration
  • Optimizing React Native page rendering, setState, or list performance
  • Configuring bundle-harmony build, Hermes bytecode, or Release build
  • Integrating or reviewing RNAbility lifecycle (onForeground/onBackground)
  • Designing or implementing TurboModule (main vs worker thread)
  • Preparing for performance analysis with Trace, React Marker, FCP, etc.

Rule Categories by Priority

Priority Category Impact Prefix
1 Render optimization CRITICAL rnoh-render-
2 Bundle & native HIGH rnoh-bundle-, rnoh-native-
3 Lifecycle & monitor HIGH rnoh-lifecycle-
4 TurboModule MEDIUM rnoh-turbo-
5 List & key MEDIUM rnoh-list-

Quick Reference

1. Render optimization (CRITICAL)

  • rnoh-render-avoid-same-state — Avoid setState when state unchanged to prevent extra renders
  • rnoh-render-pure-memo — Use PureComponent or React.memo to avoid unnecessary re-renders
  • rnoh-render-props-once — Create callbacks/prop objects once (constructor or outside component)
  • rnoh-render-split-child — Split independent UI into child components
  • rnoh-render-merge-setstate — Merge setState to avoid multiple commits and renders
  • rnoh-render-state-not-mutate — Use new objects in setState; do not mutate existing state
  • rnoh-render-batching — Keep React 18 Automatic Batching enabled (RNOH default concurrentRoot: true)

2. Bundle & native config (HIGH)

  • rnoh-bundle-release — Use --dev=false --minify=true for performance/production bundle
  • rnoh-bundle-hbc — Prefer Hermes bytecode (hermesc) for production
  • rnoh-native-release — Use Release build on native side; lower LOG_VERBOSITY_LEVEL when appropriate
  • rnoh-native-bisheng — Optionally use BiSheng compiler (buildOption.nativeCompiler: "BiSheng")

3. Lifecycle & monitoring (HIGH)

  • rnoh-lifecycle-foreground-background — Call onForeground/onBackground in onPageShow/onPageHide or onShown/onHidden
  • rnoh-lifecycle-fcp — First-frame monitoring: use mount event or root onLayout to report FCP

4. TurboModule (MEDIUM)

  • rnoh-turbo-worker — Run heavy TurboModules (JSON, crypto, image, network, I/O) on worker thread; avoid ImageLoader on worker

5. List & key (MEDIUM)

  • rnoh-list-key — Provide stable keys for list items; avoid using index as key

How to Use

  • Static checks: Apply the rules above in code review or scripts (JS/TS and config).
  • Details and examples: See the corresponding rule files under rules/ (e.g. rules/rnoh-render-pure-memo.md).
  • Full doc: Performance optimization (en).

Relation to general React Native skills

  • This skill focuses on OpenHarmony-specific React Native performance (RNAbility, bundle-harmony, HBC, TurboModule worker, Trace/React Marker).
  • It complements vercel-react-native-skills and react-native-best-practices: list virtualization (FlashList), Pressable, expo-image, StyleSheet, etc. still apply; this skill adds OpenHarmony-side config and render-optimization details.

相关文章

更多
PHP无法获取React Native Fetch POST参数的兼容解决方案

React Native使用fetch发起网络请求时,默认以application/json格式发送数据,导致PHP端$_POST变量为空数组。本文介绍两种处理思路:一是前端构建表单数据,二是服务端直接读取php://input流并解码。针对多端(iOS、Android、Web)共用同一接口的场景,提出通过自定义Header标识应用来源,在服务端增加钩子函数进行动态解码的兼容方案,无需大幅修改现有接口代码。

2026.07.09 793
emil-design-eng:打磨现有组件与动效取舍指南

emil-design-eng 是一款专注于界面设计与动画优化的技能工具,日安装量约 3279。它不替换现有组件库,而是通过提供基于 Emil Kowalski 设计理念的评审意见,帮助开发者解决进场别扭、边缘生硬等具体问题。该工具强调将设计判断视为可训练的能力,建议从指出具体动作和曲线入手,而非笼统评价。其功能涵盖从新建动画到审查删减的全流程,支持 React Native 和 Expo 环境,旨在提升界面的自然感与交互流畅度。

2026.11.07 551
design-mobile-apps衔接移动端设计与实现

通过Sleek Skill生成可编辑的设计稿件,再交由Agent编写React Native代码,可减少设计意图在实现时的走样。该流程需配置Sleek账号与API密钥,利用/api/v1/*接口获取HTML及渲染结果进行视觉对稿,但交互逻辑与无障碍属性仍需人工验收。

2026.11.18 482
React Native 跨平台通用选择弹出框封装与使用

本文介绍如何在 React Native 中封装一个适用于 iOS 和 Android 的选择弹出框组件。该组件利用动画实现平滑的显示隐藏效果,通过布尔值控制状态,并支持自定义选项数组、字体颜色及回调方法。文章提供了核心代码实现逻辑及在 Demo 中的调用示例,帮助开发者快速集成通用的用户交互界面。

2025.11.17 177
Skill 文件
  • SKILL.md
    • OpenHarmony React Native Performance Static Check Skills
    • When to Apply
    • Rule Categories by Priority
    • Quick Reference
      • 1. Render optimization (CRITICAL)
      • 2. Bundle & native config (HIGH)
      • 3. Lifecycle & monitoring (HIGH)
      • 4. TurboModule (MEDIUM)
      • 5. List & key (MEDIUM)
    • How to Use
    • Relation to general React Native skills
  • 项目或源文件

相关 Skill

更多
react-native-architecture react-native-architecture 使用 Expo、导航、原生模块、离线同步和跨平台模式构建生产级 React Native 应用。适用于开发移动应用、实现原生集成或架构 React Native
React Native React Native 使用 React Native 组件、导航和原生模块构建高性能跨平台移动应用。
Orderly Sdk React Hooks Orderly Sdk React Hooks Orderly React SDK 钩子使用参考指南,包括 useOrderEntry、usePositionStream、useOrderbookStream、useCollateral 等。
React Native Maps React Native Maps Author: q15004040209-creator
React Flow Code Review React Flow Code Review 审查 React Flow 代码,检测反模式、性能问题和最佳实践。适用于审查使用 @xyflow/react 的代码,检查常见错误...