Lesson 2.3

Passing data across the boundary

Props crossing into a client component get serialised, which is why functions and class instances fail. Composition through children keeps server-rendered content out of the bundle.

6mIntermediate13,528 students
Video thumbnail for Passing data across the boundary

Sign in to watch this lesson

Browsing is free. Create an account to play videos and track your progress.

Overview

Props crossing into a client component get serialised, which is why functions and class instances fail. Composition through children keeps server-rendered content out of the bundle.

What this lesson covers

  • Pass only serialisable props into client components
  • Use children to slot server content inside a client shell
  • Avoid leaking server-only data through props

This lesson sits in Server and Client Components, part of Next.js App Router in Depth. It assumes what came before it and leads directly into the next lesson in the module.

In this lesson you will:

  • Pass only serialisable props into client components
  • Use children to slot server content inside a client shell
  • Avoid leaking server-only data through props