跳到正文
TakoAPI
返回技能列表

react-perf

由 kjaylee 提供

Web & Frontend Development
—暂无评分
你的评分

简介

React and Next.js performance optimization patterns.

描述

该技能的功能

A collection of React and Next.js performance patterns covering waterfall elimination, bundle size reduction, re-render prevention, and server-side optimizations. Applies to standard React apps, Next.js projects, and Remotion video components.

Consolidates Vercel's 57-rule react-best-practices guide into prioritized, actionable patterns so developers skip research and apply fixes directly.

何时使用

  • Parallelizing API calls that were running sequentially
  • Reducing initial bundle size with dynamic imports
  • Preventing unnecessary re-renders in complex component trees
  • Optimizing server components to minimize client data transfer
  • Improving Remotion video render performance with memoization

示例工作流

输入

User asks: my Next.js page feels slow, multiple API calls on load

智能体
  1. 1

    Identify sequential await chains in data-fetching code

  2. 2

    Replace sequential awaits with Promise.all for independent requests

  3. 3

    Check for barrel imports and replace with direct component imports

  4. 4

    Add next/dynamic for heavy below-the-fold components

  5. 5

    Wrap parallel fetch sections in Suspense boundaries for streaming

输出

Refactored data fetching runs in parallel, bundle splits load lazily, and the page streams content progressively

安装

clawhub install kjaylee/react-perf

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接