Skip to content
Back to skills

Optimize React

ASecurity

Use when a React or Next.js page opens slowly, re-renders too much, ships too much JavaScript, or lags on a click or while scrolling. Measures one route, fixes the main cause and reports the before and after medians. Not for clicking through a flow to check that it works (test-in-browser).

  • 145 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added December 1, 2026
ai-agentsjavascriptjavareactnextjs

Works with

  • cli

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Heyvhuang/copybook-skills --skill optimize-react --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Optimize React?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Optimize React
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/heyvhuang-optimize-react/badge)](https://www.skillsdirectory.com/skills/heyvhuang-optimize-react)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: optimize-react
description: "Use when a React or Next.js page opens slowly, re-renders too much, ships too much JavaScript, or lags on a click or while scrolling. Measures one route, fixes the main cause and reports the before and after medians. Not for clicking through a flow to check that it works (test-in-browser)."
license: MIT (see LICENSE)
---

# Speed up React

## 1. Measure one milestone

Pick one route or action and a user-visible milestone, such as the product list appearing. Use a production build or a fixed preview. Record the build, device profile, fixture, cache state, and measurement method. Run at least three samples per version and record the median.

## 2. Follow the delay to its cause

Follow the measured delay to its cause:

| Evidence | First change to try |
| --- | --- |
| Requests run in series | Start independent reads together and await them at their point of use. Keep auth checks and real data dependencies in order. With streaming, put slow secondary content behind its own Suspense boundary. |
| Too much script on the first screen | Check which imports actually ship. Split large secondary features at their point of use and defer optional third-party scripts. Compare transferred JS and check the delayed feature still opens. |
| Server work repeats | Check for duplicate reads and large serialized props. Deduplicate within the request where possible. Check user and tenant boundaries before sharing a cache across requests. |
| Typing or clicking feels slow | Use the React Profiler or a browser trace to find expensive commits or long tasks. Remove unnecessary derived-state effects or narrow subscriptions before adding memoization. |

## 3. Fix the main cause and measure again

Change the main cause within the requested scope. Run the same measurement again, with the same fixture and cache policy. Check that the original content, permissions, and interactions still work. Report the before/after median, sample count, what changed, and any remaining bottleneck.

See [example.md](example.md) for a timed request waterfall.

Based on vercel-labs/agent-skills (MIT), rewritten by Copybook.

Files in this skill

  • CHANGES.md773 B
  • LICENSE1.4 KB
  • SKILL.md2.1 KB
  • example.md1.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.