Skip to main content

Updating Data 데모

Next.js App Router에서 Server Functions / Server Actions를 활용한 다양한 데이터 업데이트 패턴을 직접 체험할 수 있습니다. 각 데모는 실제 Server Action 동작을 시뮬레이션합니다.

파일 구조

updating-data/
├── layout.tsx
├── page.tsx                ← 현재 페이지 (인덱스)
├── forms/                  ← Form + Server Action
├── event-handlers/         ← onClick + Server Action
├── pending-state/          ← useActionState
├── refreshing/             ← refresh()
├── revalidating/           ← revalidatePath / revalidateTag
├── redirecting/            ← redirect
├── cookies-demo/           ← cookies() API
└── use-effect/             ← useEffect + startTransition

Tip: 모든 데모의 Server Action은 actions.ts 파일에 'use server' 지시어와 함께 정의됩니다. 루트 page.tsx는 Server Component로 유지됩니다.