Introduction to React #12 | Redux

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

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

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

    Thanks Jack Herrington for the video series on React. Learned a lot from it.

  • @WiktorJurek
    @WiktorJurek 4 ปีที่แล้ว +4

    Loving your explanations, Jack!

  • @offorjohn
    @offorjohn 7 หลายเดือนก่อน +1

    Awesome content wherever you are thank you.

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

    enjoying this tut so far...thank you so much! one suggestion is to may be mention how to install packages using npm too... npm add redux worked however...

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

    It does port quite nicely. Thank you for the explanation

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

    I was waiting for this. Thanks Jack!!!!

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

    While importing "createStore" vs code keeps nagging about using "configureStore" instead that apparently replaces createStore. (March 2023)

    • @ibrahimblahblahyapyap
      @ibrahimblahblahyapyap 7 หลายเดือนก่อน

      What's the trick to using configureStore instead of createStore?
      Edit:
      Used const store = configureStore({ reducer: pokemonReducer }) and had to downgrade my react-redux to ^7.2.8. Although it works I don't know how to clear the console warnings of failed prop types and unique key for props.

  • @diyaagubarah3328
    @diyaagubarah3328 2 ปีที่แล้ว

    So with all those different state manager when and how to selected just one of them does redux is enough?

  • @storylineteam
    @storylineteam 2 ปีที่แล้ว

    The history of Redux! or how to make Singletons, form the most hated anti-pattern to an industry standard :)

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

    So the version useReducer is the new preferred method for “global storage” over Redux?

    • @jherr
      @jherr  4 ปีที่แล้ว +5

      On its own useReducer is just an elaborate useState that can handle more complex pieces of data. So to get to global state it would be `useReducer + useContext` which, very roughly, equals Redux.
      The problem with just doing `useReducer + useContext` is that when the value to `useContext` changes then the entire tree from that point down is re-rendered. As opposed to just the components that actually need specific parts of the new value.
      So to fix that problem you could use systems like Redux, presented here, or you could use other state managers that I've covered like Zustand, Jotai, Recoil, Valtio, or MobX.

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

      Thanks for the extra explanation.

    • @jherr
      @jherr  4 ปีที่แล้ว

      @@DedicatedManagers Yeah, sorry, I guess that exposition content hit the cutting room floor. ;) Great question though!

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

      In the video you said Redux is falling out of favor... you didn’t mean in relation to useReducer/useContext but instead you meant in relation to other plugins like Zustand, Jotai, Recoil, etc., correct?

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

      @@DedicatedManagers Redux the library is falling out of favor, IMHO. But Redux the "pattern" is alive and well as `useReducer` inside of React.

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

    Pretty awesome, thanks

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

    Can you next video put redux-saga? And i love yor videos the way you explain. Thank you for your time.

    • @jherr
      @jherr  4 ปีที่แล้ว +5

      Then I'd have to learn them myself. 🤣 I gotta say, I worked for a brief while on a project with Sagas and it was just soooo tough to get my head around. I'll add it to the topics list, and I'll give you a promise, but it might not resolve. 😁

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

      @@jherr OK Jack thank you for answer...

    • @Aman-Verma
      @Aman-Verma 2 ปีที่แล้ว

      @@jherr is there any video on redux saga by you. It’s so hard to find good content on redux-saga and it’s effects. :(

    • @jherr
      @jherr  2 ปีที่แล้ว

      @@Aman-Verma th-cam.com/video/0W4SdogReDg/w-d-xo.html

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

    Thank you for a wonderful set of tutorials. You give kcdodds a run for his money ;)

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

    bravo!

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

    I like using Redux with Redux toolkit, whats your opinion on it?

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

      Pros: For large team projects it's very reliable, well understood and documented, and it's got a solid ecosystem around it of tooling and extensions.
      Cons: For small projects it's a lot of boilerplate. Some extensions, like Sagas, can make it outrageously complex. And IMHO, not support asynchronous behavior from the start, requiring thunks for that, was not a good call. Javascript is a natively asynchronous environment, solutions should embrace that.
      Honestly, I'm ok with it, but I am presenting it here more as a "thing you might encounter out there" because there are a lot of projects that use it. But I don't see a lot of folks starting new projects with it.

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

      @@jherr Sorry maybe I did not made myself clear, I was asking about redux-toolkit which I found makes redux much more simple

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

      @@TheCodingOdyssey Gotcha, yeah, redux-toolkit is good stuff. I should have mentioned it.

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

      @@jherr yeah, where I work in our latest project we used it instead of just plain redux and it reduced the 'fluff' considerably

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

      @@TheCodingOdyssey Cool. But I think the fact that you need something like redux-tools to reduce the fluff is part of the reason that folks are leaving redux. Plus, as a community, we seem to have backed off the "state in components is pure evil" stance.

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

    wonderful

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

    awesome