advanced-react-patterns-ultrasimplified
advanced-react-patterns-ultrasimplified copied to clipboard
#3 Compound Components
What is this PR about? 🤔
An API change with the Compound components pattern implemented.
Changes 🎁
- [x] Create a context object to share state with all child components
Before/After 📸
https://advanced-react-patterns-ultrasimplified.netlify.com/compound-components
Other comments 💬
The usage of the component now changes to:
<MediumClap>
<MediumClap.Icon />
<MediumClap.Total />
<MediumClap.Count />
</MediumClap>
Improvements may include:
- Exposing child component props for UI customization
Next PR 👉Compound Component with Callback