Let's go back to the ExpandableCard, which we didn't quite finish before. We could certainly do a regions-specific card, but it seems that the general concept of a card that can be expanded or condensed is useful enough that we could prefer a more general solution. React allows us to do that via composition, as we'll see in this section.
Composing components
How to do it...
The component we want to create could have any kind of content. (The same idea would apply to generic dialog boxes, header sections, or sidebars, by the way.) Instead of creating a base class and using inheritance to create multiple derived classes, React allows you to pass a special children prop (this.props.children) so that you can pass...