[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FEG8XRG71X0SBMYTGNM7YR":3,"skill-same:01M6FEG8XRG71X0SBMYTGNM7YR":45},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":25,"repositoryHtmlUrl":26,"repositoryHomepageUrl":27,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M6FEG8XRG71X0SBMYTGNM7YR","react",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fpproenca\u002Fdot-skills\u002Freact\u002FSKILL.md",[],[5],"2026-11-10 10:12:30",false,"# React 19 Best Practices\n\nComprehensive performance optimization guide for React 19\u002F19.2 applications. Contains 41 rules across 8 categories, prioritized by impact from critical (concurrent rendering, server components) to incremental (component patterns).\n\n## When to Apply\n\n- Writing new React components or refactoring existing ones\n- Optimizing re-render performance or bundle size\n- Using concurrent features (useTransition, useDeferredValue, Activity)\n- Setting up Server Components or server\u002Fclient boundaries\n- Implementing form actions, optimistic updates, or data fetching\n- Configuring React Compiler for automatic memoization\n- Reviewing React code for common anti-patterns\n\n## Rule Categories\n\n| Category | Impact | Rules | Key Topics |\n|----------|--------|-------|------------|\n| Concurrent Rendering | CRITICAL | 6 | useTransition, useDeferredValue, Activity, batching |\n| Server Components | CRITICAL | 6 | RSC boundaries, data fetching, streaming |\n| Actions & Forms | HIGH | 5 | Form actions, useActionState, useOptimistic |\n| Data Fetching | HIGH | 5 | use() hook, cache(), Suspense, error boundaries |\n| State Management | MEDIUM-HIGH | 5 | Derived values, context optimization, useReducer |\n| Memoization & Performance | MEDIUM | 5 | React Compiler, useMemo, useCallback, React.memo |\n| Effects & Events | MEDIUM | 5 | useEffectEvent, cleanup, external stores |\n| Component Patterns | LOW-MEDIUM | 4 | Composition, controlled vs uncontrolled, key reset |\n\n## Quick Reference\n\n**Critical patterns** — get these right first:\n- Fetch data in Server Components, not Client Components\n- Push `'use client'` boundaries as low as possible\n- Use `startTransition` for expensive non-blocking updates\n- Use `\u003CActivity>` to preserve state across tab\u002Fpage switches\n\n**Common mistakes** — avoid these anti-patterns:\n- Creating promises inside Client Components for `use()` (causes infinite loops)\n- Memoizing everything (use React Compiler v1.0+ instead)\n- Using effects for derived state or user event handling\n- Placing `'use client'` too high in the component tree\n\n## Table of Contents\n\n1. [Concurrent Rendering](references\u002F_sections.md#1-concurrent-rendering) — **CRITICAL**\n   - 1.1 [Use Activity for Pre-Rendering and State Preservation](references\u002Fconc-activity-component.md) — HIGH (eliminates navigation re-render cost, preserves user input state)\n   - 1.2 [Avoid Suspense Fallback Thrashing](references\u002Fconc-suspense-fallback.md) — HIGH (prevents 200-500ms layout shift flicker)\n   - 1.3 [Leverage Automatic Batching for Fewer Renders](references\u002Fconc-automatic-batching.md) — HIGH (batches multiple setState calls into a single render in all contexts)\n   - 1.4 [Use useDeferredValue for Derived Expensive Values](references\u002Fconc-use-deferred-value.md) — CRITICAL (prevents jank in derived computations)\n   - 1.5 [Use useTransition for Non-Blocking Updates](references\u002Fconc-use-transition.md) — CRITICAL (maintains \u003C50ms input latency during heavy state updates)\n   - 1.6 [Write Concurrent-Safe Components](references\u002Fconc-concurrent-safe.md) — MEDIUM-HIGH (prevents bugs in concurrent rendering)\n2. [Server Components](references\u002F_sections.md#2-server-components) — **CRITICAL**\n   - 2.1 [Avoid Client-Only Libraries in Server Components](references\u002Frsc-avoid-client-only-libs.md) — MEDIUM-HIGH (prevents build errors, correct component placement)\n   - 2.2 [Enable Streaming with Nested Suspense](references\u002Frsc-streaming.md) — MEDIUM-HIGH (progressive loading, faster TTFB)\n   - 2.3 [Fetch Data in Server Components](references\u002Frsc-data-fetching-server.md) — CRITICAL (significantly reduces client JS bundle, eliminates client-side data waterfalls)\n   - 2.4 [Minimize Server\u002FClient Boundary Crossings](references\u002Frsc-server-client-boundary.md) — CRITICAL (reduces serialization overhead, smaller bundles)\n   - 2.5 [Pass Only Serializable Props to Client Components](references\u002Frsc-serializable-props.md) — HIGH (prevents runtime errors, ensures correct hydration)\n   - 2.6 [Use Composition to Mix Server and Client Components](references\u002Frsc-composition-pattern.md) — HIGH (maintains server rendering for static content)\n3. [Actions & Forms](references\u002F_sections.md#3-actions-&-forms) — **HIGH**\n   - 3.1 [Use Form Actions Instead of onSubmit](references\u002Fform-actions.md) — HIGH (forms work without JS loaded, eliminates e.preventDefault() boilerplate)\n   - 3.2 [Use useActionState for Form State Management](references\u002Fform-use-action-state.md) — HIGH (declarative form handling, automatic pending states)\n   - 3.3 [Use useFormStatus for Submit Button State](references\u002Fform-use-form-status.md) — MEDIUM-HIGH (proper loading indicators, prevents double submission)\n   - 3.4 [Use useOptimistic for Instant UI Feedback](references\u002Fform-use-optimistic.md) — HIGH (0ms perceived latency for mutations, automatic rollback on server failure)\n   - 3.5 [Validate Forms on Server with Actions](references\u002Fform-validation.md) — MEDIUM (prevents client-only validation bypass, single source of truth for form errors)\n4. [Data Fetching](references\u002F_sections.md#4-data-fetching) — **HIGH**\n   - 4.1 [Fetch Data in Parallel with Promise.all](references\u002Fdata-parallel-fetching.md) — MEDIUM-HIGH (eliminates waterfalls, 2-5x faster)\n   - 4.2 [Use cache() for Request Deduplication](references\u002Fdata-cache-deduplication.md) — HIGH (eliminates duplicate fetches per server request)\n   - 4.3 [Use Error Boundaries with Suspense](references\u002Fdata-error-boundaries.md) — MEDIUM (isolates failures to individual components, prevents full-page crashes)\n   - 4.4 [Use Suspense for Declarative Loading States](references\u002Fdata-suspense-data-fetching.md) — HIGH (eliminates loading state boilerplate, enables parallel data fetch coordination)\n   - 4.5 [Use the use() Hook for Promises in Render](references\u002Fdata-use-hook.md) — HIGH (eliminates useEffect+useState fetch pattern, integrates with Suspense boundaries)\n5. [State Management](references\u002F_sections.md#5-state-management) — **MEDIUM-HIGH**\n   - 5.1 [Calculate Derived Values During Render](references\u002Frstate-derived-values.md) — MEDIUM (eliminates sync bugs, simpler code)\n   - 5.2 [Split Context to Prevent Unnecessary Re-renders](references\u002Frstate-context-optimization.md) — MEDIUM (reduces re-renders from context changes)\n   - 5.3 [Use Functional State Updates for Derived Values](references\u002Frstate-functional-updates.md) — MEDIUM-HIGH (prevents stale closures, stable callbacks)\n   - 5.4 [Use Lazy Initialization for Expensive Initial State](references\u002Frstate-lazy-initialization.md) — MEDIUM-HIGH (prevents expensive computation on every render)\n   - 5.5 [Use useReducer for Complex State Logic](references\u002Frstate-use-reducer.md) — MEDIUM (eliminates impossible state combinations, enables unit-testable state logic)\n6. [Memoization & Performance](references\u002F_sections.md#6-memoization-&-performance) — **MEDIUM**\n   - 6.1 [Avoid Premature Memoization](references\u002Fmemo-avoid-premature.md) — MEDIUM (removes 0.1-0.5ms per-render overhead from unnecessary memoization)\n   - 6.2 [Leverage React Compiler for Automatic Memoization](references\u002Fmemo-compiler.md) — MEDIUM (automatic optimization, less manual code)\n   - 6.3 [Use React.memo for Expensive Pure Components](references\u002Fmemo-react-memo.md) — MEDIUM (skips expensive re-renders, 5-50ms savings per unchanged component)\n   - 6.4 [Use useCallback for Stable Function References](references\u002Fmemo-use-callback.md) — MEDIUM (prevents child re-renders from reference changes)\n   - 6.5 [Use useMemo for Expensive Calculations](references\u002Fmemo-use-memo.md) — MEDIUM (skips O(n) recalculations on re-renders with unchanged dependencies)\n7. [Effects & Events](references\u002F_sections.md#7-effects-&-events) — **MEDIUM**\n   - 7.1 [Always Clean Up Effect Side Effects](references\u002Feffect-cleanup.md) — MEDIUM (prevents memory leaks, stale callbacks)\n   - 7.2 [Avoid Effects for Derived State and User Events](references\u002Feffect-avoid-unnecessary.md) — MEDIUM (eliminates sync bugs, simpler code)\n   - 7.3 [Avoid Object and Array Dependencies in Effects](references\u002Feffect-object-dependencies.md) — MEDIUM (prevents infinite loops, unnecessary re-runs)\n   - 7.4 [Use useEffectEvent for Non-Reactive Logic](references\u002Feffect-use-effect-event.md) — MEDIUM (prevents unnecessary effect re-runs from non-reactive value changes)\n   - 7.5 [Use useSyncExternalStore for External Subscriptions](references\u002Feffect-use-sync-external-store.md) — MEDIUM (prevents tearing in concurrent rendering, ensures SSR-safe external state)\n8. [Component Patterns](references\u002F_sections.md#8-component-patterns) — **LOW-MEDIUM**\n   - 8.1 [Choose Controlled vs Uncontrolled Appropriately](references\u002Frcomp-controlled-components.md) — LOW-MEDIUM (prevents form state sync bugs, enables real-time validation)\n   - 8.2 [Prefer Composition Over Props Explosion](references\u002Frcomp-composition.md) — LOW-MEDIUM (reduces prop drilling depth, enables independent component reuse)\n   - 8.3 [Use Key to Reset Component State](references\u002Frcomp-key-reset.md) — LOW-MEDIUM (forces full component remount, eliminates stale state after identity changes)\n   - 8.4 [Use Render Props for Inversion of Control](references\u002Frcomp-render-props.md) — LOW-MEDIUM (enables parent-controlled rendering without child prop explosion)\n\n## References\n\n1. [https:\u002F\u002Freact.dev](https:\u002F\u002Freact.dev)\n2. [https:\u002F\u002Freact.dev\u002Fblog\u002F2024\u002F12\u002F05\u002Freact-19](https:\u002F\u002Freact.dev\u002Fblog\u002F2024\u002F12\u002F05\u002Freact-19)\n3. [https:\u002F\u002Freact.dev\u002Fblog\u002F2025\u002F10\u002F01\u002Freact-19-2](https:\u002F\u002Freact.dev\u002Fblog\u002F2025\u002F10\u002F01\u002Freact-19-2)\n4. [https:\u002F\u002Freact.dev\u002Fblog\u002F2025\u002F10\u002F07\u002Freact-compiler-1](https:\u002F\u002Freact.dev\u002Fblog\u002F2025\u002F10\u002F07\u002Freact-compiler-1)\n5. [https:\u002F\u002Freact.dev\u002Flearn\u002Fyou-might-not-need-an-effect](https:\u002F\u002Freact.dev\u002Flearn\u002Fyou-might-not-need-an-effect)\n6. [https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact](https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact)\n\n## Related Skills\n\n- For Next.js 16 App Router, see `nextjs-16-app-router` skill\n- For client-side form handling, see `react-hook-form` skill\n- For data caching with TanStack Query, see `tanstack-query` skill\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fpproenca\u002Fdot-skills\u002Freact",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill react",{"tool":37,"command":38},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill react",{"tool":40,"command":41},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill react","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fpproenca\u002Fdot-skills\u002Freact\u002FSKILL.md",true,[],[46,55,64,73,79,85],{"skillNo":47,"name":48,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":18},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[52,53,54],"model","model hierarchy","model hierarchy skill",{"skillNo":56,"name":57,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":18},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[61,62,63],"MCP","zoom","zoom mcp",{"skillNo":65,"name":66,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":18},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[70,71,72,62],"sdk","zoom apps sdk","apps",{"skillNo":74,"name":75,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[75],{"skillNo":80,"name":81,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[81],{"skillNo":86,"name":87,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":18},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[87]]