Chapter 2 · Example 2 · Elements, children as props, and re-renders
Passing elements as props
Moving the scroll state into its own component and passing the slow content in as a prop keeps that content out of the re-render, so scrolling stays smooth.
Loading live editor…