0Pricing
Next.js 15 Fullstack (App Router + Server Actions) · 강의

Suspense와 로딩 상태를 활용한 UI 스트리밍

React Suspense, loading.tsx 파일, 스켈레톤을 사용해 서버 렌더링 UI를 스트리밍하고 사용자가 더 빨리 콘텐츠를 보도록 하여 체감 성능을 향상합니다.

Suspense와 로딩 상태를 활용한 UI 스트리밍은(는) CoddyKit의 무료 Next.js 15 Fullstack (App Router + Server Actions) 강의입니다. 이것은 4개 중 4번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Next.js 15 Fullstack (App Router + Server Actions) 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Next.js 15 Fullstack (App Router + Server Actions) 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

The Waterfall Problem

If a page waits for every data fetch before rendering, users stare at a blank screen. Streaming lets the server send ready parts of the page immediately and fill in slow parts as they finish.

What is Streaming SSR?

Next.js with the App Router can stream HTML in chunks. The shell and fast components arrive first; slow data-dependent sections stream in when ready, improving Time to First Byte and perceived speed.

React Suspense Basics

Suspense wraps a component that may not be ready and shows a fallback until it is. The rest of the page renders without waiting.

import { Suspense } from 'react';
<Suspense fallback={<p>Loading...</p>}>
  <SlowComponent />
</Suspense>

Async Server Components

In the App Router, a Server Component can be async and await data. Wrapping it in Suspense lets the page stream while that fetch resolves.

async function Reviews() {
  const data = await getReviews();
  return <ReviewList items={data} />;
}

Streaming a Slow Section

Render the page shell instantly and stream the slow part. Users interact with the rest while reviews load.

export default function Page() {
  return (
    <main>
      <Header />
      <Suspense fallback={<ReviewsSkeleton />}>
        <Reviews />
      </Suspense>
    </main>
  );
}

The loading.tsx Convention

A loading.tsx file beside a route automatically wraps that route's page in Suspense. Its export is shown instantly while the page's data loads.

// app/dashboard/loading.tsx
export default function Loading() {
  return <DashboardSkeleton />;
}

Building a Skeleton

A skeleton mimics the final layout with gray placeholders, reducing layout shift and signaling that content is coming.

function ReviewsSkeleton() {
  return (
    <div className="animate-pulse space-y-2">
      <div className="h-4 bg-gray-200 rounded" />
      <div className="h-4 bg-gray-200 rounded w-3/4" />
    </div>
  );
}

Parallel Data Fetching

Avoid sequential awaits that create waterfalls. Multiple Suspense boundaries let independent sections fetch in parallel and stream as each completes.

<Suspense fallback={<A />}><Sales /></Suspense>
<Suspense fallback={<B />}><Traffic /></Suspense>

Granular Boundaries

Place Suspense around the smallest slow unit, not the whole page. Finer boundaries mean more of the UI is interactive sooner.

Streaming vs Static

Streaming shines for personalized or slow data. For content that rarely changes, static generation or caching is still faster. Combine both: cache what you can, stream the rest.

Best Practices

Stream effectively:

  • Wrap slow async Server Components in Suspense
  • Use loading.tsx for route-level fallbacks
  • Show skeletons to cut layout shift
  • Use parallel boundaries to avoid waterfalls

Quick Check

Test your streaming knowledge.

Recap

You learned to stream UI:

  • Streaming SSR sends ready HTML first and fills slow parts later
  • Wrap async components in Suspense with a fallback
  • Use loading.tsx for automatic route fallbacks
  • Show skeletons and use parallel boundaries

Your pages now feel fast even with slow data.

자주 묻는 질문

“Suspense와 로딩 상태를 활용한 UI 스트리밍” 강의는 무료인가요?

네 — “Suspense와 로딩 상태를 활용한 UI 스트리밍” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Next.js 15 Fullstack (App Router + Server Actions) 강의 전체를 잠금 해제할 수 있습니다. Next.js 15 Fullstack (App Router + Server Actions) 강의에는 총 4개의 강의가 포함되어 있습니다.

“Suspense와 로딩 상태를 활용한 UI 스트리밍”에서 뭘 배우나요?

React Suspense, loading.tsx 파일, 스켈레톤을 사용해 서버 렌더링 UI를 스트리밍하고 사용자가 더 빨리 콘텐츠를 보도록 하여 체감 성능을 향상합니다. 브라우저에서 직접 실행하는 실습 코드로 Next.js 15 Fullstack (App Router + Server Actions)을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

Next.js 15 Fullstack (App Router + Server Actions)을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 Next.js 15 Fullstack (App Router + Server Actions)은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 4번째 강의입니다.

“Suspense와 로딩 상태를 활용한 UI 스트리밍” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 Next.js 15 Fullstack (App Router + Server Actions) 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 Next.js 15 Fullstack (App Router + Server Actions) 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. 이미지 및 글꼴 최적화
  2. 번들 크기 분석
  3. 고급 캐싱 전략
  4. Suspense와 로딩 상태를 활용한 UI 스트리밍
← Next.js 15 Fullstack (App Router + Server Actions)(으)로 돌아가기