[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7FBPFCVRGTHXPZZCTYF2RFX":3,"skill-same:01M7FBPFCVRGTHXPZZCTYF2RFX":59},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M7FBPFCVRGTHXPZZCTYF2RFX","react-component-performance",null,"Diagnose slow React components and suggest targeted performance fixes.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Freact-component-performance-antigravity-awesome-skills-main\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: react-component-performance\ndescription: Diagnose slow React components and suggest targeted performance fixes.\nrisk: safe\nsource: \"Dimillian\u002FSkills (MIT)\"\ndate_added: \"2026-03-25\"\n---\n\n# React Component Performance\n\n## Overview\n\nIdentify render hotspots, isolate expensive updates, and apply targeted optimizations without changing UI behavior.\n\n## When to Use\n\n- When the user asks to profile or improve a slow React component.\n- When you need to reduce re-renders, list lag, or expensive render work in React UI.\n\n## Workflow\n\n1. Reproduce or describe the slowdown.\n2. Identify what triggers re-renders (state updates, props churn, effects).\n3. Isolate fast-changing state from heavy subtrees.\n4. Stabilize props and handlers; memoize where it pays off.\n5. Reduce expensive work (computation, DOM size, list length).\n6. **Validate**: open React DevTools Profiler → record the interaction → inspect the Flamegraph for components rendering longer than ~16 ms → compare against a pre-optimization baseline recording.\n\n## Checklist\n\n- Measure: use React DevTools Profiler or log renders; capture baseline.\n- Find churn: identify state updated on a timer, scroll, input, or animation.\n- Split: move ticking state into a child; keep heavy lists static.\n- Memoize: wrap leaf rows with `memo` only when props are stable.\n- Stabilize props: use `useCallback`\u002F`useMemo` for handlers and derived values.\n- Avoid derived work in render: precompute, or compute inside memoized helpers.\n- Control list size: window\u002Fvirtualize long lists; avoid rendering hidden items.\n- Keys: ensure stable keys; avoid index when order can change.\n- Effects: verify dependency arrays; avoid effects that re-run on every render.\n- Style\u002Flayout: watch for expensive layout thrash or large Markdown\u002Fdiff renders.\n\n## Optimization Patterns\n\n### Isolate ticking state\n\nMove a timer or animation counter into a child so the parent list never re-renders on each tick.\n\n```tsx\n\u002F\u002F ❌ Before – entire parent (and list) re-renders every second\nfunction Dashboard({ items }: { items: Item[] }) {\n  const [tick, setTick] = useState(0);\n  useEffect(() => {\n    const id = setInterval(() => setTick(t => t + 1), 1000);\n    return () => clearInterval(id);\n  }, []);\n  return (\n    \u003C>\n      \u003CClock tick={tick} \u002F>\n      \u003CExpensiveList items={items} \u002F> {\u002F* re-renders every second *\u002F}\n    \u003C\u002F>\n  );\n}\n\n\u002F\u002F ✅ After – only \u003CClock> re-renders; list is untouched\nfunction Clock() {\n  const [tick, setTick] = useState(0);\n  useEffect(() => {\n    const id = setInterval(() => setTick(t => t + 1), 1000);\n    return () => clearInterval(id);\n  }, []);\n  return \u003Cspan>{tick}s\u003C\u002Fspan>;\n}\n\nfunction Dashboard({ items }: { items: Item[] }) {\n  return (\n    \u003C>\n      \u003CClock \u002F>\n      \u003CExpensiveList items={items} \u002F>\n    \u003C\u002F>\n  );\n}\n```\n\n### Stabilize callbacks with `useCallback` + `memo`\n\n```tsx\n\u002F\u002F ❌ Before – new handler reference on every render busts Row memo\nfunction List({ items }: { items: Item[] }) {\n  const handleClick = (id: string) => console.log(id); \u002F\u002F new ref each render\n  return items.map(item => \u003CRow key={item.id} item={item} onClick={handleClick} \u002F>);\n}\n\n\u002F\u002F ✅ After – stable handler; Row only re-renders when its own item changes\nconst Row = memo(({ item, onClick }: RowProps) => (\n  \u003Cli onClick={() => onClick(item.id)}>{item.name}\u003C\u002Fli>\n));\n\nfunction List({ items }: { items: Item[] }) {\n  const handleClick = useCallback((id: string) => console.log(id), []);\n  return items.map(item => \u003CRow key={item.id} item={item} onClick={handleClick} \u002F>);\n}\n```\n\n### Prefer derived data outside render\n\n```tsx\n\u002F\u002F ❌ Before – recomputes on every render\nfunction Summary({ orders }: { orders: Order[] }) {\n  const total = orders.reduce((sum, o) => sum + o.amount, 0); \u002F\u002F runs every render\n  return \u003Cp>Total: {total}\u003C\u002Fp>;\n}\n\n\u002F\u002F ✅ After – recomputes only when orders changes\nfunction Summary({ orders }: { orders: Order[] }) {\n  const total = useMemo(() => orders.reduce((sum, o) => sum + o.amount, 0), [orders]);\n  return \u003Cp>Total: {total}\u003C\u002Fp>;\n}\n```\n\n### Additional patterns\n\n- **Split rows**: extract list rows into memoized components with narrow props.\n- **Defer heavy rendering**: lazy-render or collapse expensive content until expanded.\n\n## Profiling Validation Steps\n\n1. Open **React DevTools → Profiler** tab.\n2. Click **Record**, perform the slow interaction, then **Stop**.\n3. Switch to **Flamegraph** view; any bar labeled with a component and time > ~16 ms is a candidate.\n4. Use **Ranked chart** to sort by self render time and target the top offenders.\n5. Apply one optimization at a time, re-record, and compare render counts and durations against the baseline.\n\n## Example Reference\n\nLoad `references\u002Fexamples.md` when the user wants a concrete refactor example.\n","# React Component Performance\n\n## Overview\n\nIdentify render hotspots, isolate expensive updates, and apply targeted optimizations without changing UI behavior.\n\n## When to Use\n\n- When the user asks to profile or improve a slow React component.\n- When you need to reduce re-renders, list lag, or expensive render work in React UI.\n\n## Workflow\n\n1. Reproduce or describe the slowdown.\n2. Identify what triggers re-renders (state updates, props churn, effects).\n3. Isolate fast-changing state from heavy subtrees.\n4. Stabilize props and handlers; memoize where it pays off.\n5. Reduce expensive work (computation, DOM size, list length).\n6. **Validate**: open React DevTools Profiler → record the interaction → inspect the Flamegraph for components rendering longer than ~16 ms → compare against a pre-optimization baseline recording.\n\n## Checklist\n\n- Measure: use React DevTools Profiler or log renders; capture baseline.\n- Find churn: identify state updated on a timer, scroll, input, or animation.\n- Split: move ticking state into a child; keep heavy lists static.\n- Memoize: wrap leaf rows with `memo` only when props are stable.\n- Stabilize props: use `useCallback`\u002F`useMemo` for handlers and derived values.\n- Avoid derived work in render: precompute, or compute inside memoized helpers.\n- Control list size: window\u002Fvirtualize long lists; avoid rendering hidden items.\n- Keys: ensure stable keys; avoid index when order can change.\n- Effects: verify dependency arrays; avoid effects that re-run on every render.\n- Style\u002Flayout: watch for expensive layout thrash or large Markdown\u002Fdiff renders.\n\n## Optimization Patterns\n\n### Isolate ticking state\n\nMove a timer or animation counter into a child so the parent list never re-renders on each tick.\n\n```tsx\n\u002F\u002F ❌ Before – entire parent (and list) re-renders every second\nfunction Dashboard({ items }: { items: Item[] }) {\n  const [tick, setTick] = useState(0);\n  useEffect(() => {\n    const id = setInterval(() => setTick(t => t + 1), 1000);\n    return () => clearInterval(id);\n  }, []);\n  return (\n    \u003C>\n      \u003CClock tick={tick} \u002F>\n      \u003CExpensiveList items={items} \u002F> {\u002F* re-renders every second *\u002F}\n    \u003C\u002F>\n  );\n}\n\n\u002F\u002F ✅ After – only \u003CClock> re-renders; list is untouched\nfunction Clock() {\n  const [tick, setTick] = useState(0);\n  useEffect(() => {\n    const id = setInterval(() => setTick(t => t + 1), 1000);\n    return () => clearInterval(id);\n  }, []);\n  return \u003Cspan>{tick}s\u003C\u002Fspan>;\n}\n\nfunction Dashboard({ items }: { items: Item[] }) {\n  return (\n    \u003C>\n      \u003CClock \u002F>\n      \u003CExpensiveList items={items} \u002F>\n    \u003C\u002F>\n  );\n}\n```\n\n### Stabilize callbacks with `useCallback` + `memo`\n\n```tsx\n\u002F\u002F ❌ Before – new handler reference on every render busts Row memo\nfunction List({ items }: { items: Item[] }) {\n  const handleClick = (id: string) => console.log(id); \u002F\u002F new ref each render\n  return items.map(item => \u003CRow key={item.id} item={item} onClick={handleClick} \u002F>);\n}\n\n\u002F\u002F ✅ After – stable handler; Row only re-renders when its own item changes\nconst Row = memo(({ item, onClick }: RowProps) => (\n  \u003Cli onClick={() => onClick(item.id)}>{item.name}\u003C\u002Fli>\n));\n\nfunction List({ items }: { items: Item[] }) {\n  const handleClick = useCallback((id: string) => console.log(id), []);\n  return items.map(item => \u003CRow key={item.id} item={item} onClick={handleClick} \u002F>);\n}\n```\n\n### Prefer derived data outside render\n\n```tsx\n\u002F\u002F ❌ Before – recomputes on every render\nfunction Summary({ orders }: { orders: Order[] }) {\n  const total = orders.reduce((sum, o) => sum + o.amount, 0); \u002F\u002F runs every render\n  return \u003Cp>Total: {total}\u003C\u002Fp>;\n}\n\n\u002F\u002F ✅ After – recomputes only when orders changes\nfunction Summary({ orders }: { orders: Order[] }) {\n  const total = useMemo(() => orders.reduce((sum, o) => sum + o.amount, 0), [orders]);\n  return \u003Cp>Total: {total}\u003C\u002Fp>;\n}\n```\n\n### Additional patterns\n\n- **Split rows**: extract list rows into memoized components with narrow props.\n- **Defer heavy rendering**: lazy-render or collapse expensive content until expanded.\n\n## Profiling Validation Steps\n\n1. Open **React DevTools → Profiler** tab.\n2. Click **Record**, perform the slow interaction, then **Stop**.\n3. Switch to **Flamegraph** view; any bar labeled with a component and time > ~16 ms is a candidate.\n4. Use **Ranked chart** to sort by self render time and target the top offenders.\n5. Apply one optimization at a time, re-record, and compare render counts and durations against the baseline.\n\n## Example Reference\n\nLoad `references\u002Fexamples.md` when the user wants a concrete refactor example.\n",{"name":5,"risk":24,"source":25,"date_added":26,"description":7},"safe","Dimillian\u002FSkills (MIT)","2026-03-25","main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","06-前端与设计\u002Freact-component-performance-antigravity-awesome-skills-main",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill react-component-performance",{"tool":41,"command":42},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill react-component-performance",{"tool":44,"command":45},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill react-component-performance","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Freact-component-performance-antigravity-awesome-skills-main\u002FSKILL.md",true,[49,55],{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"agents\u002Fopenai.yaml","REFERENCE","参考文档",238,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Freact-component-performance-antigravity-awesome-skills-main\u002Fagents\u002Fopenai.yaml",{"path":56,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Fexamples.md",2381,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Freact-component-performance-antigravity-awesome-skills-main\u002Freferences\u002Fexamples.md",[60,67,72,79,86,93],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],{"skillNo":68,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]