OpenHarmony React Native Performance
by @code-sunbo
OpenHarmony React Native performance static checks and optimization. Based on ohos_react_native performance doc. Use when writing or reviewing React Native for OpenHarmony code, bundle-harmony, lifecycle, or TurboModule. Applies to RNAbility, Hermes bytecode, React render optimization.
clawhub install ohos-react-native-performanceπ About This Skill
name: ohos-react-native-performance description: OpenHarmony React Native performance static checks and optimization. Based on ohos_react_native performance doc. Use when writing or reviewing React Native for OpenHarmony code, bundle-harmony, lifecycle, or TurboModule. Applies to RNAbility, Hermes bytecode, React render optimization. license: MIT metadata: author: OpenHarmony-SIG / homecheck repository: https://gitcode.com/openharmony-sig/homecheck path_in_repo: skills/ohos-react-native-performance source_en: https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/en/performance-optimization.md source_zh: https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/ζ§θ½θ°δΌ.md version: '1.0.0'
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:
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 rendersrnoh-render-pure-memo β Use PureComponent or React.memo to avoid unnecessary re-rendersrnoh-render-props-once β Create callbacks/prop objects once (constructor or outside component)rnoh-render-split-child β Split independent UI into child componentsrnoh-render-merge-setstate β Merge setState to avoid multiple commits and rendersrnoh-render-state-not-mutate β Use new objects in setState; do not mutate existing staternoh-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 bundlernoh-bundle-hbc β Prefer Hermes bytecode (hermesc) for productionrnoh-native-release β Use Release build on native side; lower LOG_VERBOSITY_LEVEL when appropriaternoh-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/onHiddenrnoh-lifecycle-fcp β First-frame monitoring: use mount event or root onLayout to report FCP4. TurboModule (MEDIUM)
rnoh-turbo-worker β Run heavy TurboModules (JSON, crypto, image, network, I/O) on worker thread; avoid ImageLoader on worker5. List & key (MEDIUM)
rnoh-list-key β Provide stable keys for list items; avoid using index as keyHow to Use
rules/ (e.g. rules/rnoh-render-pure-memo.md).