rn-performance
最佳化 React Native 效能
React Native 應用程式可能會遇到清單緩慢、額外渲染和 JS 執行緒停滯等問題。這項技能提供專注於更快的 FlatList 畫面、記憶化元件、最佳化 selector、快取圖片和效能分析的模式。
使用我的智慧代理安裝
將此請求複製給你的智慧代理,其中包含權威 Skill 頁面和清單。
Review the Skillstore skill "rn-performance" from https://skillstore.io/skills/cjharmath-rn-performance.md and its manifest at https://skillstore.io/api/skills/cjharmath-rn-performance/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智慧代理仍應顯示其計畫,並依安全政策請求必要確認。
Agent 可讀資源
當 AI Agent、爬蟲或腳本需要乾淨脈絡、而不是讀取完整頁面時,請使用這些連結。
測試它
正在使用「rn-performance」。 球員名錄畫面在捲動數百列時會卡頓。
預期結果:
- 使用基於球員 ID 的穩定項目 key。
- 將列項目渲染移到記憶化的項目元件中。
- 如果列高固定,加入 getItemLayout。
- 如果效能分析仍顯示清單瓶頸,考慮使用 FlashList。
正在使用「rn-performance」。 當一個 Zustand 值變更時,儀表板會重新渲染每張卡片。
預期結果:
- 避免在儀表板中選取整個 store。
- 為每張卡片的值使用特定 selector。
- 當元件需要多個相關值時,使用 shallow comparison。
- 再次進行效能分析,確認只有變更的卡片會渲染。
正在使用「rn-performance」。 畫面在導覽後計算排名時會短暫凍結。
預期結果:
- 在導覽期間分析 JS 執行緒。
- 將繁重工作延後到互動完成後執行。
- 在排名輸入會被重複使用時進行記憶化。
- 將長時間執行的計算移出初始渲染路徑。
安全審計
安全All static findings were adjudicated as false positives. The detections come from Markdown fences, inline backticks, TypeScript examples, and a React.memo prop comparison in a documentation-only skill. No prompt injection, external command execution, network access, filesystem access, or data exfiltration intent was found in SKILL.md.
風險因素
⚙️ 外部命令 (40)
分享與引用此報告
分享版本化評估報告、中性徽章、嵌入卡片與引用。Skillstore 只報告證據,不判斷該 Skill 是否安全。
複製報告連結
https://skillstore.io/skills/cjharmath-rn-performance/audits/7?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/cjharmath-rn-performance?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/cjharmath-rn-performance?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/cjharmath-rn-performance/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/cjharmath-rn-performance.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>學術引用 (APA · BibTeX · CFF)
APA 引用
CJHarmath. (2026). rn-performance security audit report (audit version 7) [Author version unspecified]. Skillstore. https://skillstore.io/skills/cjharmath-rn-performance/audits/7BibTeX 引用
@techreport{cjharmath-cjharmath-rn-performance-2026,
author = {CJHarmath},
title = {rn-performance security audit report (audit version 7)},
institution = {Skillstore},
year = {2026},
number = {7},
url = {https://skillstore.io/skills/cjharmath-rn-performance/audits/7},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "rn-performance security audit report (audit version 7)"
version: "unspecified"
type: report
authors:
- name: "CJHarmath"
date-released: "2026-07-06"
url: "https://skillstore.io/skills/cjharmath-rn-performance/audits/7"
identifiers:
- type: other
value: "skillstore:cjharmath-rn-performance:audit:7"
description: "Skillstore immutable audit report identifier"
Skillstore 評分
評分依據 證據置信度: 高你可以打造什麼
修復卡頓的清單畫面
診斷緩慢的 FlatList 畫面,並套用穩定 key、項目版面配置、記憶化列項目和渲染視窗設定。
審查發布效能
在發布前檢查大量清單畫面中的可避免渲染、昂貴 selector、圖片快取問題和 JS 執行緒阻塞。
教導渲染衛生習慣
使用範例說明記憶化何時有幫助、何時會增加額外負擔,以及如何分析渲染行為。
試試這些提示
Review this React Native list screen for obvious performance issues. Focus on stable keys, renderItem, getItemLayout, and inline callbacks.
Analyze these components for unnecessary re-renders. Recommend where React.memo, useMemo, useCallback, or StyleSheet.create would help.
Review this Zustand usage for selector problems. Suggest focused selectors, shallow comparison, and safer component boundaries.
Create a prioritized performance plan for this React Native feature. Include profiling steps, list changes, image handling, memoization, and JS thread risks.
最佳實務
- 先進行效能分析,再最佳化實際造成延遲的元件或清單。
- 先使用穩定的 props 和 selector,再加入廣泛的記憶化。
- 在真實裝置上驗證改善效果,尤其是較低階的 Android 硬體。
避免
- 不要在未衡量成本的情況下記憶化每個簡單值。
- 不要將 inline 物件或 callback 傳入記憶化的子元件。
- 當元件只需要一個值時,不要選取整個 Zustand store。