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.

КОМЕНТАРІ • 16

  • @Showmatic
    @Showmatic 5 місяців тому

    I've used this method to create a reusable accordion component. Really useful

  • @fgh77413
    @fgh77413 5 місяців тому

    Congratulations on the work, excellent content!

    • @SakuraDev
      @SakuraDev  5 місяців тому

      Much appreciated!

  • @RonnieDenzel
    @RonnieDenzel 5 місяців тому +1

    Nice work,but when do we apply this,I'm a bit confused😅

    • @SakuraDev
      @SakuraDev  5 місяців тому +1

      Thanks. When we have some components that have close interaction with each other we can use this pattern, an example could be Accordion component. 🙏

    • @RonnieDenzel
      @RonnieDenzel 5 місяців тому

      @@SakuraDev ahhh nice,thanks for the clarification, already subscribed 😅

    • @SakuraDev
      @SakuraDev  5 місяців тому

      @@RonnieDenzel Thanks for your support 🙏

  • @Edwinil
    @Edwinil 5 місяців тому

    What should I do, if a want to share the state outnof the Card Component? I mean share the hook as well

    • @SakuraDev
      @SakuraDev  5 місяців тому

      To do this, You have 2 options. The first is to create your context outside of the Card component.

    • @SakuraDev
      @SakuraDev  5 місяців тому

      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.

    • @SakuraDev
      @SakuraDev  5 місяців тому

      Hope That helps you

  • @nisabmohd
    @nisabmohd 5 місяців тому

    Hi can you please tell me the font you're using

    • @SakuraDev
      @SakuraDev  5 місяців тому

      Hi, it's jetbrain

  • @SaivivekRavi
    @SaivivekRavi 4 місяці тому

    hi can you send your setting.json please i have subscribed i want theme font size and font family
    hope you reply

    • @SakuraDev
      @SakuraDev  4 місяці тому

      Hi, The theme is bearded them and the font is jetbrains font