Skip to content
Back to skills

React Performance

ASecurity

React and Next.js performance optimization — eliminate waterfalls, reduce bundle size, optimize renders, server-side patterns. 70+ rules by impact priority. Profile first, optimize second.

  • 10 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 9, 2026
ai-agentsreactnextjsgitperformance

Works with

  • cli

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add yanacuti1121/Yana-AI --skill react-performance --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of React Performance?

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

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

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: react-performance
description: React and Next.js performance optimization — eliminate waterfalls, reduce bundle size, optimize renders, server-side patterns. 70+ rules by impact priority. Profile first, optimize second.
license: MIT
source: https://github.com/affaan-m/ECC
---

# React Performance

Ordered by impact. Fix P1 before P2. Profile before adding memo.

**Trigger phrases:** "slow React", "performance", "bundle size", "waterfall", "re-render", "optimize Next.js", "LCP", "FCP"

---

## P1 — Waterfall Elimination

```tsx
// ❌ Sequential
const user = await getUser(id)
const posts = await getPosts(user.id)

// ✅ Parallel
const [user, posts] = await Promise.all([getUser(id), getPosts(id)])
```

---

## P2 — Bundle Size

```tsx
// ✅ Dynamic imports
const HeavyChart = dynamic(() => import('./Chart'), { loading: () => <Skeleton />, ssr: false })

// ✅ Tree-shake
import { debounce } from 'lodash/debounce'   // ✅ not import from 'lodash'
```

Target: JS bundle < 200KB gzipped per route.

---

## P3 — Server-Side Patterns

```tsx
// Server Component — zero client JS
async function ProductList() {
  const products = await db.products.findMany({ take: 20 })
  return <ul>{products.map(p => <ProductCard key={p.id} {...p} />)}</ul>
}

// Cache expensive computations
import { cache } from 'react'
const getUser = cache(async (id: string) => db.users.findUnique({ where: { id } }))
```

---

## P4 — Client Data Fetching

```tsx
const { data } = useQuery({ queryKey: ['users'], queryFn: getUsers, staleTime: 1000 * 60 * 5 })
```

---

## P5 — Re-render Prevention

```tsx
const ExpensiveList = memo(({ items }) => <ul>{items.map(i => <Item key={i.id} {...i} />)}</ul>)
const handleClick = useCallback((id: string) => setSelected(id), [])
const sorted = useMemo(() => items.sort(compareFn), [items])
```

**Only add memo after React DevTools Profiler confirms the cost.**

---

## P6 — Virtualize Long Lists

```tsx
import { useVirtualizer } from '@tanstack/react-virtual'
// For lists > 100 items
```

---

## Anti-Fake-Pass

```
❌ Adding memo everywhere without profiling — adds overhead
❌ Parallel fetches split across separate useEffect → still sequential
❌ No staleTime in TanStack Query → refetches on every focus
❌ Large images without next/image
```

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.

Comments

Loading comments…

Newsletter

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