← スキル一覧に戻る

react-performance
by HoangNguyen0403
react-performanceは、other分野における実用的なスキルです。複雑な課題への対応力を強化し、業務効率と成果の質を改善します。
⭐ 111🍴 40📅 2026年1月23日
SKILL.md
name: React Performance description: Optimization strategies for React applications (Client & Server). metadata: labels: [react, performance, optimization, nextjs] triggers: files: ['/*.tsx', '/*.jsx'] keywords: [waterfall, bundle, lazy, suspense, dynamic]
React Performance
Priority: P0 (CRITICAL)
Strategies to minimize waterfalls, bundle size, and render cost.
Elimination of Waterfalls (P0)
- Parallel Data: Use
Promise.allfor independent fetches. Avoid sequentialawait. - Preload: Start fetches before render (in event handlers or route loaders).
- Suspense: Use Suspense boundaries to stream partial content.
Bundle Optimization (P0)
- No Barrel Files: Import directly
import { Btn } from './Btn'vsimport { Btn } from './components'. - Lazy Load:
React.lazy/next/dynamicfor heavy components (Charts, Modals). - Defer: Load 3rd-party scripts (Analytics) after hydration.
Rendering & Re-renders (P1)
- Isolation: Move state down. Isolate heavy UI updates.
- Context Splitting: Split Context into
StateContext(Data) andDispatchContext(Actions) to prevent consumers from re-rendering just because they need a setter. - Stability: Use
useMemofor passing objects/arrays to children to preserve referential equality checks (React.memo). - Virtualization:
react-windowfor lists > 50 items. - Content Visibility:
content-visibility: autofor off-screen CSS content. - Static Hoisting: Extract static objects/JSX outside component scope.
- Transitions:
startTransitionfor non-urgent UI updates.
Parallelization (P1)
- Web Workers: Move heavy computation (Encryption, Image processing, Large Data Sorting) off the main thread using
ComlinkorWorker.
Server Performance (RSC) (P1)
- Caching:
React.cachefor per-request deduplication. - Serialization: Minimize props passing to Client Components (only IDs/primitives).
Anti-Patterns
- No
export *: Breaks tree-shaking. - No Sequential Await: Causes waterfalls.
- No Inline Objects:
style={{}}breaks strict equality checks (if memoized). - No Heavy Libs: Avoid moment/lodash (use dayjs/radash).
Code
// Parallel Fetching (Good)
const [user, posts] = await Promise.all([getUser(), getPosts()]);
// Bundle Optimized Import (Good)
import { Button } from './components/Button'; // Not from './components'
// Static Hoist (Good)
const STATIC_CONFIG = { theme: 'dark' };
function Component() {
return <div config={STATIC_CONFIG} />;
}
スコア
総合スコア
85/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
✓説明文
100文字以上の説明がある
+10
✓人気
GitHub Stars 100以上
+5
✓最近の活動
1ヶ月以内に更新
+10
✓フォーク
10回以上フォークされている
+5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
レビュー
💬
レビュー機能は近日公開予定です

