Compound Pattern in React | #30 React Course

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ก.ย. 2024

ความคิดเห็น • 34

  • @nicus1504
    @nicus1504 3 หลายเดือนก่อน

    Aren't you creating a circular dependency between ProductCard and ProductCardDescription? One of the rules in projects I work on is to never import anything from parent components.

    • @CodewithSloba
      @CodewithSloba  2 หลายเดือนก่อน

      if there is a circular dependency I'm pretty sure it would crash.

    • @nicus1504
      @nicus1504 2 หลายเดือนก่อน

      @@CodewithSloba no, it won't crash, but you're creating a potential case that's hard to debug.

    • @CodewithSloba
      @CodewithSloba  2 หลายเดือนก่อน

      I see your angle

  • @codewithtae6637
    @codewithtae6637 ปีที่แล้ว +1

    This sounds like something you would want to do early in a project. If you don't the refactor might be a nightmare!

    • @CodewithSloba
      @CodewithSloba  ปีที่แล้ว

      Yes absolutely, all design and architectural decisions should be made as early as possible.
      That’s why planning is so important

  • @leonardocarvalho4111
    @leonardocarvalho4111 9 หลายเดือนก่อน +1

    Amazing content, thank you. I finally understood why and how to use this pattern with your example.

    • @CodewithSloba
      @CodewithSloba  8 หลายเดือนก่อน +1

      Glad it was helpful!

  • @chillaxabhinav
    @chillaxabhinav 4 หลายเดือนก่อน +1

    Very good video and simple explanation. 🥳

  • @yabancakali94
    @yabancakali94 10 หลายเดือนก่อน +1

    Perfect video, I was struggling to get the concept but your video made it clear! Thanks!

    • @CodewithSloba
      @CodewithSloba  8 หลายเดือนก่อน

      I'm glad you like it

  • @zoki5388
    @zoki5388 ปีที่แล้ว +1

    Da li mozes napraviti video na temu typescript i useContext & useReducer.

    • @CodewithSloba
      @CodewithSloba  ปีที่แล้ว

      useReducer sam vec napravio pogledaj video 25 iz ove serije. useContext je 12 video u ovoj seriji. Samo je ostao typescript to cu svakako odraditi u nekom od sledecih videa

  • @GuilleMorton
    @GuilleMorton 10 หลายเดือนก่อน

    Do you have an example of this but for render dinamically and those flags you defined at the start being properties of each element of an array? I dont get the concept if is not going to be used for just hardcoded stuff

    • @CodewithSloba
      @CodewithSloba  8 หลายเดือนก่อน

      I don't have concrete example but this should give you just an idea

  • @yashwanthsrinivas
    @yashwanthsrinivas ปีที่แล้ว

    Thanks for the awesome video! One of the very few videos that explained this properly!

    • @CodewithSloba
      @CodewithSloba  8 หลายเดือนก่อน

      I'm glad you like it!

  • @md.asifal-mahmud5952
    @md.asifal-mahmud5952 ปีที่แล้ว +1

    Nice.

  • @_tanzil_
    @_tanzil_ 11 หลายเดือนก่อน

    Thanks for the clear explanation with simple example.

    • @CodewithSloba
      @CodewithSloba  11 หลายเดือนก่อน

      Glad it was helpful!

  • @frank13621
    @frank13621 6 หลายเดือนก่อน

    Perfect thank you.

    • @CodewithSloba
      @CodewithSloba  6 หลายเดือนก่อน

      You’re welcome

  • @darshilvaria441
    @darshilvaria441 11 หลายเดือนก่อน

    Great explaination!

  • @ankushladani496
    @ankushladani496 ปีที่แล้ว

    Great ..❤

  • @СамирАбасов
    @СамирАбасов ปีที่แล้ว

    Thank you, but I do not like it

    • @CodewithSloba
      @CodewithSloba  ปีที่แล้ว

      Why not?

    • @СамирАбасов
      @СамирАбасов ปีที่แล้ว

      @@CodewithSloba The first version looked better. You create a component in one place and use it in many. Let it look messy in one place rather than everywhere else. This is purely my opinion and I could be wrong. (Translated by DeepL)

    • @CodewithSloba
      @CodewithSloba  ปีที่แล้ว +2

      @@СамирАбасов The thing is that compound components doesn’t look messy, they are much cleaner.
      Sometimes more code means more readability. Also this way component implementation is much simpler and more protected from bugs and weird logic.
      Also it’s much more versatile

  • @beloaded3736
    @beloaded3736 ปีที่แล้ว

    Hvala veliko Slobo, dobro objasnjeno.