Skip to main content

Refreshing 데모

Server Action 내에서 refresh()를 호출하면 클라이언트 라우터가 갱신되어 UI에 최신 데이터가 반영됩니다. 제목을 변경하고 제출해보세요.

핵심 코드

// actions.ts
'use server'
import { refresh } from 'next/cache'

export async function updatePost(formData: FormData) {
  // Update data...
  refresh()  // 클라이언트 라우터 갱신
}
← 데모 목록으로 돌아가기