跳到正文
TakoAPI
返回技能列表

ohos-react-native-performance

由 code-sunbo 提供

Web & Frontend Development
636下载量由 clawskills.sh 提供
1浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

OpenHarmony React Native performance static checks and optimization.

描述

该技能的功能

Static-check rules for React Native on OpenHarmony (RNOH), derived from the official ohos_react_native performance-optimization documentation. Covers render optimization, bundle configuration, RNAbility lifecycle, TurboModule threading, and list performance. Rules are categorized by priority from critical render issues to medium-impact list handling.

General React Native performance guides don't cover OpenHarmony-specific concerns like bundle-harmony, HBC compilation, BiSheng compiler options, or RNAbility lifecycle, so this skill fills that gap without requiring manual doc lookup.

何时使用

  • Reviewing RNOH code for unnecessary re-renders before a release
  • Configuring Hermes bytecode and Release builds for a production bundle
  • Auditing TurboModule implementations to ensure heavy work runs on worker threads
  • Checking RNAbility lifecycle hooks are wired to onPageShow/onPageHide correctly
  • Enforcing stable list keys across a team codebase via code review rules

示例工作流

输入

User asks: review this RNOH component for performance issues

智能体
  1. 1

    Check for setState calls where new value equals current state (rnoh-render-avoid-same-state)

  2. 2

    Check if functional components or class components lack React.memo or PureComponent (rnoh-render-pure-memo)

  3. 3

    Check if callbacks or prop objects are recreated on each render instead of being stable references (rnoh-render-props-once)

  4. 4

    Check if multiple setState calls could be merged into one (rnoh-render-merge-setstate)

  5. 5

    Check list items for missing or index-based keys (rnoh-list-key)

输出

Annotated list of rule violations with rule IDs and fix suggestions

安装

clawhub install code-sunbo/ohos-react-native-performance

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接