Set of Examples of React Compound Components Using React Context API
Compound components are components which co-exists. It allows you to create components which share state implicitly.
It Contains Following Comppund Component Examples:
<Tabs>
<TabHeader />
<TabDetails />
</Tabs>
It can be also used in following way:
<Tabs>
<TabDetails />
<TabHeader />
</Tabs>
- Show all controls
<AudioPlayer source={Mario_Bros_Medley}>
<Controls />
</AudioPlayer>
- Show Only Play Control
<AudioPlayer source={Mario_Bros_Medley}>
<Play />
<ProgressBar />
</AudioPlayer>
- Show Play and Pause Control
<AudioPlayer source={Mario_Bros_Medley}>
<Play />
<Pause />
<ProgressBar />
</AudioPlayer>
- Show Play/Pause Control
<AudioPlayer source={Mario_Bros_Medley}>
<PlayPause />
<ProgressBar />
</AudioPlayer>
It can be used in many different ways.
npm i
npm start