Context vs Redux: What to Choose? - Experts Zone #6 | frontendhouse.com

Поділитися
Вставка
  • Опубліковано 31 лип 2024
  • When should you use Redux and when Context will be the best option? Find out in the podcast by Piotr Czubak. Check the contents 👇 We can help your company with development issues: contact us via form on frontendhouse.com/.
    0:00 - Intro
    0:34 - Agenda
    0:50 - What is the application state?
    1:05 - Passing props through components
    1:50 Tools to manage application state: Context API and Redux
    5:18 - Advantages of Context
    5:47 - Advantages of Redux
    6:13 - Which one should you choose?
    Have a nice watch! Don’t forget to like the video and leave comments to share your impressions! ⚡
    Prefer reading? Check the transcription on our website frontendhouse.com/experts-zon...
  • Наука та технологія

КОМЕНТАРІ • 26

  • @souravraychaudhuri6600
    @souravraychaudhuri6600 Рік тому +5

    To summarize: Whenever a Context provider's state changes, Context will cause a re-render to all the components (parent or child) consuming that context (which CANNOT be controlled). This is exactly the behaviour expected when prop-drilling is done. On the other hand, Redux will cause (dispatch) re-render to only those components which are ingesting a certain value (selector) from the store.
    [ A caveat to this is that the same behaviour of Redux can be induced into Context as well, by having different contexts (ProContext and ConContext). You would have to manually write different contexts, so that one context's state change would not cause re-render to a component consuming a different context. Redux does the same out-of-the-box]

  • @nanonkay5669
    @nanonkay5669 2 роки тому +47

    TLDR: Is the project big and state is ever changing ? Use Redux : Use Context

  • @flowerofash4439
    @flowerofash4439 2 роки тому +6

    after 2 months using usecontext i just realized the everything re-render stuff, well you cannot notice any performance change if your app is simple and rarely use states, but for a big app this is a serious matter

  • @akhilchandra5935
    @akhilchandra5935 2 роки тому +3

    Amazing tutorial, short and sweet. What I wanted. Thanks my friend :)

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

    incredibly easy explanation, probably the best one I've seen

  • @sergiisechka1993
    @sergiisechka1993 2 роки тому

    Great delivery! Thank you Piotr!

  • @huxlysingh4067
    @huxlysingh4067 2 роки тому +1

    Thank you understand clearly!!

  • @danielzambrano2158
    @danielzambrano2158 2 роки тому +4

    Solid video, needed the comparison. You should increase the videos size and reduce the size of your face cause thhe code font was small.

    • @FrontendHouse
      @FrontendHouse  2 роки тому

      Thank you! You're right, we will make the font bigger. Do you have any ideas on what comparisons we have to do next? :)

  • @lukor-tech
    @lukor-tech 2 роки тому +4

    Nice bit of knowledge for newcomers, great delivery

  • @febobebo9634
    @febobebo9634 2 роки тому +5

    Can't we just use useMemo with Context API and prevent unnecessary renders as well?

    • @guilleblog
      @guilleblog 2 роки тому +3

      When the child/consumer component is subscribed to a context, it doesn't matter if it only consumes one state or several, any change in any state of the context re-renders the component even using memo. Anyway, we can configure memo in a better way using the second parameter that it accepts but everything becomes more complicated and we have to do memo maintenance... When we use redux + memo the component only re-rendered when a specific state that we are consuming changes... and memo does not need more configuration.

  • @0x0abb
    @0x0abb 2 роки тому +2

    It would be nice to have the screen just bigger - hard to see

  • @spirita4072
    @spirita4072 Рік тому

    Really informative stuff 👏

  • @clebhosh
    @clebhosh 2 роки тому +5

    Thank you very much, please increase your font size on the tutorials.

    • @FrontendHouse
      @FrontendHouse  2 роки тому +1

      Noticed! Thank you for your feedback

  • @456fghbsrtywrtwre
    @456fghbsrtywrtwre 8 місяців тому

    sorry, 4k and you can't see the text. terrible

  • @akshaysanthosh5787
    @akshaysanthosh5787 12 днів тому

    Don't add background music when speaking bro

  • @ChillAutos
    @ChillAutos 2 роки тому

    Should definitely work on talking to the camera just not reading off a script. It was really jarring. Otherwise good video.

  • @htmlfivedev
    @htmlfivedev 2 роки тому +3

    Your intro is half the size of your video ... thumbs down ...

    • @FrontendHouse
      @FrontendHouse  2 роки тому +1

      You're right, we have to shorten the intro 👍👍

  • @renanbrayner984
    @renanbrayner984 11 місяців тому

    Too much lipsmacking...