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.
Use this skill when:
| 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- |
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)
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")
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
rnoh-turbo-worker — Run heavy TurboModules (JSON, crypto, image, network, I/O) on worker thread; avoid ImageLoader on worker
rnoh-list-key — Provide stable keys for list items; avoid using index as key
rules/ (e.g. rules/rnoh-render-pure-memo.md).
共 1 个版本