React Compound Pattern and Context API
Вставка
- Опубліковано 14 жов 2024
- In this video, I'll be explaining React Context API with React Compound Pattern.
The video starts with an introduction to compound component pattern. This pattern is useful when you want to create reusable components that can be nested. The video then dives into how to use React Context API with compound components.
I've used this method to create a reusable accordion component. Really useful
Excellent!
Congratulations on the work, excellent content!
Much appreciated!
Nice work,but when do we apply this,I'm a bit confused😅
Thanks. When we have some components that have close interaction with each other we can use this pattern, an example could be Accordion component. 🙏
@@SakuraDev ahhh nice,thanks for the clarification, already subscribed 😅
@@RonnieDenzel Thanks for your support 🙏
What should I do, if a want to share the state outnof the Card Component? I mean share the hook as well
To do this, You have 2 options. The first is to create your context outside of the Card component.
The second option which I prefer, is that you crate a onClick event function for the card component and the each time the button is clicked, you pass out the value of ringNum with the event function.
Hope That helps you
Hi can you please tell me the font you're using
Hi, it's jetbrain
hi can you send your setting.json please i have subscribed i want theme font size and font family
hope you reply
Hi, The theme is bearded them and the font is jetbrains font