Community생산성 & 협업github.com

vercel-labs/vercel-react-모범-사례

Vercel 엔지니어링 팀이 제공하는 React 및 Next.js 성능 최적화 가이드라인입니다. React 컴포넌트, Next.js 페이지, 데이터 페칭, 번들 최적화 또는 성능 개선과 관련된 작업에서 활용하세요.

vercel-react-모범-사례란 무엇인가요?

이 스킬은 Vercel 엔지니어링 팀이 제공하는 React 및 Next.js 성능 최적화 모범 사례를 정의합니다. 주로 React 컴포넌트 작성, 코드 리뷰, 리팩토링 작업에서 최적의 성능 패턴을 보장하기 위해 트리거됩니다. 핵심 원칙으로는 불필요한 리렌더링 방지를 위한 메모이제이션(Memo, useMemo, useCallback) 사용, Next.js App Router에서의 스트리밍 및 서버 컴포넌트 활용, 그리고 번들 크기 최소화를 위한 동적 가져오기(dynamic import) 등이 포함됩니다. 이 스킬은 Claude Code, Cursor, Codex와 같은 AI 에이전트 플랫폼에서 사용할 수 있으며, 개발자에게 성능 병목 지점을 식별하고 최신 React 및 Next.js API를 올바르게 적용하는 방법을 안내합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/vercel-labs/agent-skills/tree/main/skills/vercel-react-best-practices

Installed? Explore more 생산성 & 협업 skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

vercel-react-모범-사례은(는) 무엇을 하나요?

Vercel 엔지니어링 팀이 제공하는 React 및 Next.js 성능 최적화 가이드라인입니다. React 컴포넌트, Next.js 페이지, 데이터 페칭, 번들 최적화 또는 성능 개선과 관련된 작업을 작성, 검토, 리팩토링할 때 이 스킬을 사용하세요.

주요 원칙

  • 메모이제이션: 불필요한 리렌더링을 방지하기 위해 React.memo, useMemo, useCallback을 적절히 사용합니다.
  • 서버 컴포넌트: 가능한 경우 서버 컴포넌트를 사용하여 클라이언트 번들 크기를 줄입니다.
  • 스트리밍: Next.js App Router의 loading.js와 Suspense 경계를 활용하여 스트리밍 및 점진적 렌더링을 구현합니다.
  • 동적 가져오기: next/dynamic과 React.lazy를 사용하여 코드 분할을 적용하고 초기 로딩 시간을 최적화합니다.
  • 효율적인 데이터 페칭: 데이터 캐싱, 재검증, 병렬 데이터 페칭을 통해 성능을 향상시킵니다.

코드 예시

올바른 메모이제이션 사용

import { memo, useMemo, useCallback } from 'react';

// 리렌더링 방지를 위해 컴포넌트를 메모이제이션
const ExpensiveComponent = memo(({ data, onAction }: { data: Item[]; onAction: (id: string) => void }) => {
  // 비용이 많이 드는 연산 결과를 메모이제이션
  const sortedData = useMemo(() => {
    return data.sort((a, b) => a.name.localeCompare(b.name));
  }, [data]);

  // 콜백 함수 메모이제이션
  const handleAction = useCallback((id: string) => {
    onAction(id);
  }, [onAction]);

  return (
    <ul>
      {sortedData.map(item => (
        <li key={item.id} onClick={() => handleAction(item.id)}>{item.name}</li>
      ))}
    </ul>
  );
});

서버 컴포넌트 활용

// app/page.tsx (서버 컴포넌트)
import { Suspense } from 'react';
import Loading from './loading';

async function getData() {
  const res = await fetch('https://api.example.com/data', { next: { revalidate: 60 } });
  return res.json();
}

// 클라이언트에 전송되는 JavaScript를 최소화하기 위해 서버에서 데이터 페칭
export default async function Page() {
  const data = await getData();

  return (
    <div>
      <h1>내 데이터</h1>
      <Suspense fallback={<Loading />}>
        <DataList data={data} />
      </Suspense>
    </div>
  );
}

동적 가져오기로 번들 크기 최적화

import dynamic from 'next/dynamic';

// 무거운 컴포넌트를 동적으로 가져와 초기 번들에서 제외
const HeavyChart = dynamic(() => import('../components/HeavyChart'), {
  loading: () => <p>차트 로딩 중...</p>,
  ssr: false, // 클라이언트 사이드에서만 렌더링
});

export default function Dashboard() {
  return (
    <div>
      <h1>대시보드</h1>
      <HeavyChart />
    </div>
  );
}

동기

이 스킬은 React 및 Next.js 애플리케이션에서 일반적인 성능 문제를 방지하고 Vercel 엔지니어링 모범 사례를 일관되게 적용하기 위해 설계되었습니다. 초점을 맞추는 영역:

  • 클라이언트 자바스크립트 번들 크기를 최소화하여 초기 로딩 시간 단축
  • 서버 리소스를 효율적으로 사용하여 응답 시간 향상
  • 리렌더링 패턴을 최적화하여 애플리케이션의 응답성 유지

관련 리소스

Individual skills in this repo

This repo contains 11 individual skills — each has its own dedicated page.

deploy-to-vercel

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

vercel-cli-with-tokens

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g.

vercel-composition-patterns

React composition patterns that scale. Use when refactoring components with

vercel-labs/vercel-composition-patterns

React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.

vercel-labs/vercel-react-native-skills

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

vercel-labs/vercel-react-view-transitions

Guide for implementing smooth, native-feeling animations using React's View Transition API (`<ViewTransition>` component, `addTransitionType`, and CSS view transition pseudo-elements). Use this skill whenever the user wants to add page transitions, animate route changes, create shared element animations, animate enter/exit of components, animate list reorder, implement directional (forward/back) navigation animations, or integrate view transitions in Next.js. Also use when the user mentions view transitions, `startViewTransition`, `ViewTransition`, transition types, or asks about animating between UI states in React without third-party animation libraries.

vercel-optimize

Use for Vercel cost and performance optimization on deployed projects, especially Next.js, SvelteKit, Nuxt, and limited Astro apps. Collect Vercel metrics, usage, project config, and code scan results first; investigate only metric-backed candidates; produce ranked recommendations grounded in verified files and version-aware Vercel/framework docs. Trigger for Vercel bill reduction, slow or expensive routes, caching opportunities, Function Invocations, Build Minutes, Fast Data Transfer, Core Web Vitals, Bot Management, Fluid compute, or cost breakdown requests.

vercel-react-best-practices

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

vercel-react-native-skills

React Native and Expo best practices for building performant mobile apps. Use

web-design-guidelines

Review UI code for Web Interface Guidelines compliance. Use when asked to

writing-guidelines

Review docs/prose for Writing Guidelines compliance. Use when asked to

관련 스킬