Chapter 4 · Example 2 · Advanced configuration with render props

Sharing state through render props

Button keeps its own hovered state and passes it to the render function, so the consumer can swap icons or change classNames based on that state.

Loading live editor…