Vercel React Best Practices
Build React and Next.js code that fits modern app-router, component, data-fetching, and deployment expectations.
Use When
- Editing React, Next.js, server components, client components, route handlers, or UI state.
- Reviewing frontend architecture, hydration issues, bundle size, streaming, caching, or server/client boundaries.
- Adding production-grade React features to an existing app.
Playbook
- Inspect the existing project conventions before adding patterns.
- Keep server-only code out of client components.
- Keep client components focused on interactivity, browser APIs, and local UI state.
- Prefer typed props and small components with clear ownership.
- Avoid unnecessary global state; use URL state, server data, or local state when simpler.
- Verify with TypeScript and the narrowest relevant UI/runtime check.
Guardrails
- Do not migrate routing, styling, or state libraries unless the user explicitly asks.
- Do not add dependencies for problems the app already solves.
- Do not enable this by default for every agent; enable it for React/Next.js implementation roles.