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.

Duration
6m
Level
Intermediate
Students
14k students

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.

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

Resources

Next.js documentation

The official reference for the tools used in this lesson.