CodePark/ questions / Server & Client Components
START PRACTICINGPRACTICE
Frontend question · Next.js › Server & Client Components

A Server Component renders <Chart ... />, where Chart is a Client Component. Which prop cannot be passed?

An inline arrow function such as onSelect={() => log(id)}

The inline arrow function is the prop you cannot pass. Props that cross from server to client must be serializable, meaning React can turn them into data and send them over the network. Ordinary functions cannot be serialized. The tempting "A Server Action defined with "use server"" is fine, because React passes Server Actions as references. Plain objects of strings and numbers, and Promises, are also supported.