composition
Building bigger components by combining smaller ones, often by passing elements in as children or other props.
In more detail
Composition is how React shares layout and behaviour without inheritance. Passing a component as children lets an intermediate layout skip props it does not use, which avoids prop drilling. Custom hooks compose logic in the same way components compose markup.
Related terms
- children prop — The special React prop holding whatever is placed between a component's opening and closing tags.
- Client Component — A component whose code is also sent to the browser so it can use state, effects and event handlers.
- React Server Components — React components that run only on the server, sending their rendered result to the browser without shipping their code.
- slot — A place in a component's layout that the consumer fills with their own content, either through a named prop such as icon or through a Slot component.
- prop drilling — Passing a value through several layers of components that do not use it, just so a deeply nested one can.
- custom hook — Your own function whose name starts with use and that calls other hooks, packaging stateful logic so several components can reuse it.
Taught in
- Client Components: use client & Hydration Models — Next.js 15 & Modern App Router Architecture
- Component Tree Composition: Interleaving RSC & Client — Next.js 15 & Modern App Router Architecture
- Granular Suspense: Resolving Waterfall Bottlenecks — Next.js 15 & Modern App Router Architecture
- Request Memoization: Automatic Deduplication Tiers — Next.js 15 & Modern App Router Architecture
- Props Contract: Immutability, Children, And Polymorphic Tags — React 19 & Modern Component Architecture
- useImperativeHandle: Controlled Ref Forwarding Boundaries — React 19 & Modern Component Architecture
- Lifting State Up: Colocation, Ownership, And Data Flow — React 19 & Modern Component Architecture
- Compound Components: Inversion of Control with Context — React 19 & Modern Component Architecture
- Higher-Order Components And Render Props: Tradeoff Analysis — React 19 & Modern Component Architecture
- Slot Patterns And Headless UI Architecture in React — React 19 & Modern Component Architecture
- Rules of Hooks: Call Order, Hook Lists, And Fiber Storage — React 19 & Modern Component Architecture
- Custom Hook Composition: Encapsulating Reactive Logic — React 19 & Modern Component Architecture