react-best-practices
Optimize React and Next.js Performance with Vercel Best Practices
ใใกใใใใๅ ฅๆใงใใพใ: vercel-labs,0xBigBoss,0xBigBoss
Poor React performance leads to slow load times and frustrated users. This skill provides 45 prioritized rules from Vercel Engineering to eliminate waterfalls, reduce bundle sizes, and optimize rendering.
ในใญใซZIPใใใฆใณใญใผใ
Claudeใงใขใใใญใผใ
่จญๅฎ โ ๆฉ่ฝ โ ในใญใซ โ ในใญใซใใขใใใญใผใใธ็งปๅ
ใชใณใซใใฆๅฉ็จ้ๅง
ใในใใใ
ใreact-best-practicesใใไฝฟ็จใใฆใใพใใ Review this data fetching pattern for waterfalls
ๆๅพ ใใใ็ตๆ:
- ISSUE: Sequential await calls create waterfall (3 round trips)
- const user = await fetchUser()
- const posts = await fetchPosts()
- const comments = await fetchComments()
- ย
- FIX: Use Promise.all() for parallel execution (1 round trip)
- const [user, posts, comments] = await Promise.all([
- fetchUser(),
- fetchPosts(),
- fetchComments()
- ])
ใreact-best-practicesใใไฝฟ็จใใฆใใพใใ How do I lazy load a heavy code editor component
ๆๅพ ใใใ็ตๆ:
- Use next/dynamic for lazy loading heavy components:
- ย
- import dynamic from 'next/dynamic'
- ย
- const MonacoEditor = dynamic(
- () => import('./monaco-editor').then(m => m.MonacoEditor),
- { ssr: false, loading: () => <LoadingSkeleton /> }
- )
- ย
- This defers ~300KB bundle until component renders, improving TTI.
ใปใญใฅใชใใฃ็ฃๆป
ๅฎๅ จStatic analyzer detected 912 patterns but all are FALSE POSITIVES. The skill contains markdown documentation with code examples for educational purposes, not executable code. Patterns like 'backtick execution' are shell commands in README examples (pnpm build), 'dynamic imports' are React next/dynamic usage examples, 'storage access' shows localStorage caching patterns, and 'network' patterns are fetch API documentation examples. No actual security vulnerabilities exist.
ๅ่ณชในใณใข
ไฝใใใใฎ
Frontend Developer Building React Applications
Use this skill when writing new components or pages to ensure optimal performance from the start. The skill guides bundle optimization, proper data fetching patterns, and re-render prevention techniques.
Tech Lead Reviewing Pull Requests
Reference these rules during code review to catch performance anti-patterns like sequential async calls, unnecessary barrel imports, or missing Suspense boundaries before merging.
AI Assistant Refactoring Legacy Code
Apply these prioritized rules to systematically improve existing React codebases, starting with critical waterfall elimination before addressing medium-impact rendering optimizations.
ใใใใฎใใญใณใใใ่ฉฆใ
Review this React component using Vercel best practices. Identify waterfalls, unnecessary re-renders, and bundle optimization opportunities. Suggest specific fixes with code examples.
Refactor this code to eliminate async waterfalls. Use Promise.all() for independent operations and move awaits into branches where results are actually needed.
Apply code splitting strategies to this component. Identify opportunities for next/dynamic imports, conditional loading, and preloading on user interactions.
Analyze this component for unnecessary re-renders. Apply memoization, proper dependency arrays, derived state subscriptions, and functional setState patterns as appropriate.
ใในใใใฉใฏใใฃใน
- Start with critical waterfall elimination before medium-impact optimizations
- Use React.cache() for per-request deduplication and LRU cache for cross-request caching
- Extract stable callbacks using functional setState and store handlers in refs when needed
ๅ้ฟ
- Sequential await calls for independent operations
- Importing entire utility libraries instead of specific functions
- Passing functions directly as effect dependencies instead of primitives
ใใใใ่ณชๅ
What React versions are supported?
Can I use this with JavaScript instead of TypeScript?
Should I apply all 45 rules at once?
Does this skill work with Next.js App Router?
How do I measure performance improvements?
Can Claude Code automatically apply these fixes?
้็บ่ ใฎ่ฉณ็ดฐ
ไฝๆ่
sickn33ใฉใคใปใณใน
MIT
ใชใใธใใช
https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/react-best-practicesๅ็ ง
main
ใใกใคใซๆงๆ
๐ rules/
๐ _sections.md
๐ _template.md
๐ advanced-event-handler-refs.md
๐ async-api-routes.md
๐ async-defer-await.md
๐ async-parallel.md
๐ async-suspense-boundaries.md
๐ bundle-defer-third-party.md
๐ bundle-dynamic-imports.md
๐ bundle-preload.md
๐ client-event-listeners.md
๐ client-swr-dedup.md
๐ js-batch-dom-css.md
๐ js-cache-function-results.md
๐ js-cache-property-access.md
๐ js-cache-storage.md
๐ js-early-exit.md
๐ js-hoist-regexp.md
๐ js-index-maps.md
๐ js-min-max-loop.md
๐ rendering-animate-svg-wrapper.md
๐ rendering-conditional-render.md
๐ rendering-content-visibility.md
๐ rendering-hydration-no-flicker.md
๐ rendering-svg-precision.md
๐ rerender-derived-state.md
๐ rerender-functional-setstate.md
๐ rerender-lazy-state-init.md
๐ rerender-memo.md
๐ server-after-nonblocking.md
๐ server-cache-lru.md
๐ server-parallel-fetching.md
๐ AGENTS.md
๐ metadata.json
๐ README.md
๐ SKILL.md