Signature
Parameters
Component
required
The parent component that will receive the slots.
object
required
An object mapping slot names to components.
Returns
The original component with slot components attached as static properties.Examples
Basic
With Context
Extending Slots
Add more slots to an existing compound component:Multiple Levels
Slots can have their own slots:Behavior
displayName Preservation
withSlots preserves the original component’s displayName for React DevTools: