Compound Components

Compound Components 的开发模式很不错,适合于构建复杂层次的组件类库。主要是由于 React Context API 的出现组件的结构更方便了。

这篇文章解释得也很好: https://qiita.com/seya/items/d08b8a6c12f3e71d5971 (链接备份

demo: https://codesandbox.io/s/104lvmynj4