Learn useReducer In 20 Minutes

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

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

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

    The second example was a lot to take in but I think once I understand the design pattern, the whole concept becomes clear. Thank you for the great explanation

  • @dl88889
    @dl88889 3 ปีที่แล้ว +91

    This is easily still the best introduction to useReducer. Clear, concise. Way better than some of the paid classes I attended.

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

    You made it very easy kyle Thank you so much here is my learning from the above explanation:-
    1.) UseReducer hook gives us an array of [state,dispatch] same as useState hook and use Reducer itself takes an reducer function , inital state.
    2.) Whenver we runs an dispatch function the reducer function get's triggered and with the help of reducer function we can update new state.
    3.) Reducer function takes 2 arguments which is the current state and action and the parameter action is used to write the logic based on the dispatch action type.
    4.) Dispatch function takes an object (action) which contains two things action_type the action which we want to perform and also it takes payload which contains all the variables which we want to pass to over reducer function.
    Once Again thank you so much Kyle for the great explanation.

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

    That answers the question in my head : “why would I use useReducer while I have useState” because it’s always being compared to useState or explained with simple increment Function. Instead of saying they’re similar, saying that you can group multiple functions through conditions in a master function in order manage state in various ways, minimize prop drills and coming up with a simple todo app as you did was genious! Thanks man, I learn a lot from your tuts

  • @devc.krishna8573
    @devc.krishna8573 4 ปีที่แล้ว +18

    Its the best react hooks series on the entire internet

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

    amazing content, really impressed with your communication skills and how you break down things into understandable chunks

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

    Can't believe I comeback to this video again after 1 year. I bumped with useReducer in a react project and relized I completely frogot about how it works.
    Thank you again Kyle!!

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

    Kyle - Thanks for these great videos. I actually ran into issue the other day at work and went back to one of your videos and articles I'm subscribed to and it helped me in getting that bug fixed. Keep up the good work, man!

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

    This video is amazing. It's the best tutorial on useReducer I've seen! I love how easy it is to follow because you started with a really easy example by replacing useState with useReducer and then moved on to a more complex one with the todo app.

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

    I spent like two days on a udemy course trying to understand this concept and the guy was WAY overcomplicating it and this video saved my life lol, someone from that course linked this video in the lecture comments and it's the ONLY way I got past that part of the course. THANK YOU

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

      was that course : React the complete guide by maximillian?

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

      Yup, same story for me. And yes, it was Max from Academind.

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

      I left his course because of overcomplicating examples.. He is too fast and doesn't simplify things

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

    Its actually insane how good you can explain what you are doing. Thank you so much :)

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

    It helped me a lot to understand the Redux concept. well done.!

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

    This tutorial is one of the most useful coding tutorials I've seen so far. Really happy with the way it's all being explained :)

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

    This is basically redux, great stuff

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

    This is my first stop whenever I have to learn a new concept in JavaScript...….thanks for simplifying the Web

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

    Kyle, we really need a repo with all of these hooks examples to use them as reminder :)
    Thank you for great tutorials!

    • @temzeks
      @temzeks 3 ปีที่แล้ว

      we can make one

    • @iJuce
      @iJuce 3 ปีที่แล้ว

      @@temzeks ok go make one ! :D

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

      pls check Full React Course in description

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

      @@zetaalpha3319 bruh.

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

    Best react hooks tutorial

  • @Rsh_technical
    @Rsh_technical 2 หลายเดือนก่อน +1

    You have done such a fantastic explanation
    🎉🎉🎉
    I have watched Indian channels code with Harry thappa technical but I never understood
    But yours explanation was best

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

    GREATEST ONE AT ALL.
    I was taking a course in 'UDEMY' and he was teaching useReducer but personally I didn't understand anything. This one was so helpful Thank you for your effort and for simplifying the web for us ^ ^ ;

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

    BRO, you are GOD! Your explanation is so much better than in the Udemy course I'm taking.

  • @hoangcuongtran4606
    @hoangcuongtran4606 3 ปีที่แล้ว +7

    Actually those who familiar with redux would find this more easier! Thank you for your lesson sir !

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

    Man you're like 23y/o and knows more than a Senior developer 💯

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

      is he Junior developer? 🤔

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

      Senior developers know more about engineering in general. System Design, Data Structures, OOP, communication are all skills that senior devs will need to know. I know I'm going to catch so much hate for this.

    • @Justin-ei1qf
      @Justin-ei1qf 3 ปีที่แล้ว +33

      @@RickyGarcia_Learning that is 100% correct, primarily system design and TONS of social skills that young people lack. Being a senior isnt only being able to program on your own, its being able to lead a team of devs, something young devs without much work experience will just lack. simplifies is really knowledgeable in the tech aspect tho for sure!

    • @KevinBeal
      @KevinBeal 3 ปีที่แล้ว +21

      @@RickyGarcia_Learning Rawr! I hate you! Just kidding.

    • @SupunPraneeth
      @SupunPraneeth 3 ปีที่แล้ว +38

      well, this is not senior level, this is React basics. don't get me wrong, I really like his videos, but you can't tell he knows more than a Senior developer just by looking at this video.

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

    Best explanation out of four, I watched so far.

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

    7:29 If you're already using Typescript, another alternative would be to define type as 'increment' | 'decrement'

  • @mma-dost
    @mma-dost 2 ปีที่แล้ว +1

    Great tutorial Kyle . For beginners second to-do example might be difficult but dont give up try to understand today tomorrow until you get it and watch this video 2-3 times and read some articles on the internet.

  • @satya-lifevlogs
    @satya-lifevlogs 3 ปีที่แล้ว +2

    You are like a saviour for React mankind. Loved your work, man!

  • @Enes-ik4bm
    @Enes-ik4bm 2 ปีที่แล้ว

    Respect from Turkey. Your teaching skill is very good 🙂

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

    I watched many videos about useReducer but this one cleared all my concepts about it

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

    Kyle, you don't know how much time you've saved me for learning this hook.

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

    Thank you for this. Your videos on hooks are the best videos I could find on TH-cam.

  • @learncodingwithahmet
    @learncodingwithahmet 3 ปีที่แล้ว

    It's me again. I'm back to tell you how much this video helped me. You are the best !

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

    Mate I've discovered your channel yesterday. I am not a frontend guy, but since yesterday I watched over 10 videos and bought one of courses which btw is flawless!! Love your presenting style and the content!! I have had senior guys in my teams that don't know 1/10th of the things you teach here!! And most importantly you cut to the chase, no BS!! Kudos and keep going!! Thanks for inspiring us!

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

      Thank you so much for the support. I am glad I have been able to help.

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

      small world dude

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

    AND JUST LIKE THAT I learnt how to use useReducer. Short and informative video. Thanks man !

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

    I never comment but this time i was impressed by how well you explain and your knowledge, you never disappoint.

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

    A single video clears all the concepts

  • @Amitverma-mb4tu
    @Amitverma-mb4tu 3 ปีที่แล้ว

    Not aware of your experience and others but me as a sr. developers find your videos quiet useful.

  • @jaisalshah7731
    @jaisalshah7731 3 ปีที่แล้ว

    The best explanation on this planet so far.... Great Thanks

  • @prvizpirizad4336
    @prvizpirizad4336 3 ปีที่แล้ว

    you have a special skill to explain everything on very simple examples, so you are making it impossible to not to understand.!!

  • @bekiGYD
    @bekiGYD 4 หลายเดือนก่อน +3

    1 Million tanks from Ethiopia

  • @DuyTran-ss4lu
    @DuyTran-ss4lu 4 ปีที่แล้ว +11

    Super concise and informative. This is truly "simplified". Thanks a lot!

  • @shurui91
    @shurui91 3 ปีที่แล้ว +14

    "The idea behind useReducer is it gives you a more concrete way to handle complex state so it gives you to set actions that you can perform on your state and it's going to convert your current state to a new version of the state based the action you send it."

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

      It's so much easier if you know "why". Most documentations and tutorials often focus on "how" and that's annoying.

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

      @@CastleShield Facts

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

    Best explanation in the Internet. Great!!

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

    Thank you so much Kyle, you’ve made me fall in love with React! I love the power of this hook!

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

    I have always had an issue in wrapping my head around State Management. After watching this not only I got familiar but understood state management concepts in general. I was able read and implement Redux (In Production) after watching this. After seeing the benefits, I went ahead implemented state management in Angular(Akita) application(In Production). You should do another video on Redux with Redux Toolkit. It would benefit many people like me.

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

    Clear, easy to understand and direct.
    Just what I needed! Thanks man!

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

    Can you please do a video on some flux design patterns with Context, useReducer, and async calls to an API? Im trying to replace Redux and Thunk with pure React hooks. Thank you for your videos!

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

      Is it possible to completely replace redux with react hooks? like for global state management?

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

      @@farhanvk7586 As far as I understand it, Redux creates a global store for your app, and there is no convenient way of doing that with just hooks. But you can capture some state in one component with useContext, and then import that state in any other component and use it there.

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

      @@Andrewiththeaudi yes, if context API works then use it.
      th-cam.com/video/lG6Z0FQj_SI/w-d-xo.html
      This video gives a good explanation of context API and some other react tips.

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

      you can replace redux by using useContext combined with useReducer i recomand you to watch codeEvolution channel to learn more about that ;)

  • @RobiulIslam-dn9mm
    @RobiulIslam-dn9mm 2 ปีที่แล้ว

    amazing.. it was a very hard part of React for me, but now, it's crystal clear to me after watching Kyle's tutorial.
    Thanks Brother.

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

    Bro literally has best voice of any of these tutorials videos.

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

    best video about reducer i've seen so far, many thx wds

  • @hugoperez1318
    @hugoperez1318 3 ปีที่แล้ว +8

    Dude, useReducer just blew my mind. After building an app with more than 20 functions that update the state being passed around, just a useReducer would have been so much better. Great explanation Kyle! So much better than going through the pain of Redux while keeping the benefits of state management

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

      I'm new to reducers and Redux but I don't understand why one needs Redux over useReducer

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

      @@petiks6391 Redux scales really nicely. It is a better choice for bigger apps.

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

      @@hugoperez1318 I see. Thank you

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

    that's the most complicated and crazy hook iv'e seen so far
    thanks!

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

    I was confused about this hook and even some others but now I am clear and can use where it needs. So, going to watch the other tuts of hooks. Thank you very much for the clarification with a live example

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

    exceptionally clear intro to this topic with a great example. thanks

  • @joelwalkley3902
    @joelwalkley3902 3 ปีที่แล้ว

    Super helpful, reading the docs wasn't clicking for me. Thanks for taking the time to offer this!!

  • @hammam92
    @hammam92 9 หลายเดือนก่อน

    I love you man. Amazing explanation. Best react tutor ever

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

    This is incredible. I'm pretty new to react. I once tried using useState for a complicated state and ended up abandoning the project lol. UseReducer was exactly what I was trying to do with useState then.

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

    this is one of the best vids out there on the topic, thanks so much

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

    Just wanna say - I've watched a few of your videos, and they've all been very useful, well explained and presented in a digestible manner.

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

    Brilliant video for getting introduced to react useReducer hook. Thank you so much.

  • @overcolck777
    @overcolck777 3 ปีที่แล้ว

    10000000000000000000000 likes for this explanation. Kudos!!

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

    Personally, I prefer to create those helper functions (toggleTodo, deleteTodo) instead of just sending the dispatch method down. Actions that are available can be more explicit than just exposing the entire dispatch method.
    Awesome tutorial series Kyle, thanks a bunch.

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

      That's the right approach in my opinion... It makes the dumb component cleaner and keeps the logic in one place

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

      same lol

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

    woww just wowww!!!! you make things so damn easy. Thank you so much Kyle!

  • @ealamtaher6050
    @ealamtaher6050 3 หลายเดือนก่อน +1

    thanks a useReducer has never been more clear

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

    thanks! your ability to explain complex concepts and implement them effortlessly for us while walking through your thought process is insane. thank you for making these resources free

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

    first 2 minutes, and i can say the is the best explanation of useReducer

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

    wonderful video , the second example just makes everything clear about useReducer

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

    Your tutorials are so clean and informative, thank you for all the work you do!

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

    Amazing lecture, Thank you :)

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

    dude you are killing it with react tutorials

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

      he copies them from other dudes

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

      @@aammssaamm this is open source knowledge, you can find this information in the documentation and various articles online all he is doing is explaining it and "simplifying" it

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

      @@azatecas no, he is copying other dev's videos made long time ago

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

      @@aammssaamm can you link to another tutorial to contrast and compare the videos?

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

      @@azatecas you can easily find them by searching unless you have no idea about how to LOL

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

    You talk straight to the point, no bs around and great explanation :) love this channel

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

    Man! This helped me understood useReact much much better! Thank you so much!! Going to implement it into my current work. Can't wait to dive into your other vids!

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

    Thank you so much for making this demo. I went through the steps carefully and have a better grasp on the concept. This was a good demo.

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

    that's probably the best explanation of react's useReducer Hook!! thank you very much for the simplification

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

    your lecture's are exaptational and easy to understand, my only suggestion is please provide the Git code also

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

    This is one of my favorite channels, thanks for everything

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

    Can't thank you enough! This complicated theme is so much easy now after your explanation!

  • @klc3rd
    @klc3rd 3 ปีที่แล้ว

    This is an excellent video. I was going through a video guide on react (which was great) but once it got to reducers I got pretty confused. This is super helpful.

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

    After binging 3 of these in a row I'm pretty sure I'll be buying your course. You are a great teacher, awesome job!

  • @rBroneak
    @rBroneak 3 ปีที่แล้ว

    Well done sir! I've a few of your react vids to help understand and use react in a more powerful and organized way. Very generous of you and very appreciated!

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

    Great explanation, took me a couple tutorials to understand why you use this hook rather then use.state, think i need to practice a little more with its use but really starting to get to grips with react, thanks!

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

    Thank you very much, although I am Vietnamese, when I read materials on this issue in Vietnamese, I found it somewhat difficult to understand. But it's strange that when I watched your video in English, I understood it very clearly.

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

    thanks sir its help a lot , i watch the tutorial on Traversy where you guess but been really confuse when you use useReducer there but watching it here its now crystal clear for me hehehe , thanks again

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

    @6:30 another nice way to create a symbol for like 'const INCREMENT = Symbol()' and same with the 'DECREMENT'

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

    Awesome vid. I like the examples to help understand not just what it does but how to implement it.

  • @alyssadeng6462
    @alyssadeng6462 3 ปีที่แล้ว

    Thank you so much for these examples. I was confused by the React docs because I wasn't sure what types state and todo were supposed to be and am not familiar enough with typescript to understand the source code. Definitely learned within 20 minutes!

  • @liamsmith-yp3xh
    @liamsmith-yp3xh 4 ปีที่แล้ว

    just for those who havent done much with switch or also people who are working with objects and having a hard time, the case its self is a function so you can do case
    ACTIONS.add:{ some logic in here, return new reducer value}
    i had a hard time figuring out how to manipulate objects, after a lot of trial and error i figured out this is how you could manipulate it
    case ACTIONS.add :{
    state[payload.key]= payload.value;
    return {...state}
    }
    for some reason you have to return a clone of what ever you want to send back, something to do with sending it a shallow copy probably, but that works , manipulate state input locally within the case function and return clone of the state

  • @lothuts
    @lothuts 3 ปีที่แล้ว

    Basically... teach us react-redux without actually teaching react-redux. Great video and hook tutorial!

  • @hasibulhasanhasib3242
    @hasibulhasanhasib3242 9 หลายเดือนก่อน

    This was a very clear tutorial. Thank you very much.

  • @js_programmer8423
    @js_programmer8423 3 ปีที่แล้ว

    I'm convinced this guy's an Web Developer Alien.. he's just perfect at everything including life.

  • @dusanvulic7275
    @dusanvulic7275 3 ปีที่แล้ว

    Best useReduce( ) explanation !!!!

  • @mirabbosbotirjonov
    @mirabbosbotirjonov 3 ปีที่แล้ว

    This is how fbp (function based programming) works
    Kyle it would be great video to those who are learning resux or useReducer if you teach a fbp

  • @Someone-ct2ck
    @Someone-ct2ck 3 ปีที่แล้ว

    Thank you, man. This is really web dev simplified.

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

    Really a great class! I learned how to use it in the first 5 minutes following along :P Everything got much more clearer to me, thanks!

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

    Thank you so much for making this video, it is so helpful.

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

    Very helpful. Thanks for all the great React content! Some of the best I can find on the internet

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

    Thanks bro! you're a beast of a coder and teacher

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

    Kyle, thank you for these excellent videos. They are simple and quick. They are really helping. Again thank you for your great work. Love your videos

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

    Thank you so much for explaining how we pass one `dispatch` function instead of many different handlers. So far in the major project I'm working on, I've only see useReducer used for context providers, and nothing else. And I've seen several places where handleX, handleY, and handleZ are passed in. I think this could be useful to refactor.

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

    Great explanation. I really appreciate how you break it down even further with the examples. Helps explain the Hook better than the React Docs.

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

    U R A GEM BROOO !!