The useReducer React hook seems more complicated at first, but after you learn how to use it, useReducer really simplifies state management compared to tracking many different pieces of state that are all implemented with the useState hook. Once you learn about the useReducer hook, I think you will agree! Just getting started with React? If so, I recommend starting with my 9 hour full course React tutorial here: kzbin.info/www/bejne/iIepcqx8jLRnndE
@Tajdev2 жыл бұрын
You have not demonstrated how to pass it to component. Please also make video of it.
@m1dway Жыл бұрын
@@Tajdev just pass it in an input parameter. Ex:
@andrews13 Жыл бұрын
Tried many tutorials for learning useReducer, but got confused more only. Finally I found this video which is the perfect one!! Simple, great & straight forward!
@DaveGrayTeachesCode Жыл бұрын
Glad I could help!
@jingli9232 Жыл бұрын
the best tutorial for useReducer, super clear and simple to understand, what a teacher!
@DaveGrayTeachesCode Жыл бұрын
Glad it was helpful!
@pablocodeglia2 жыл бұрын
What a great and easy-to-get explanation for a pretty confusing topic. Excellent work, thanks Dave!
@DaveGrayTeachesCode2 жыл бұрын
Glad it was helpful!
@SagarKumar-db2xy2 жыл бұрын
Hands down the best tutorial. I am writing this comment after watching maybe 20+ videos and that too from top youtubers, but no one really simplified this much. I just have a request, please make a medium size project using useContext for global state management and useReducer to change them. Pls.
@DaveGrayTeachesCode2 жыл бұрын
Thank you, Sagar! I appreciate the request, too. I do need to post some projects. 🙏💯
@minimumt3n204 Жыл бұрын
Showing how its similar to useState and rewriting it using useReducer makes it so much more clear! Thank you!
@DaveGrayTeachesCode Жыл бұрын
You're welcome!
@zb2747 Жыл бұрын
Best tutorial and explanation I found - thank you Dave!
@DaveGrayTeachesCode Жыл бұрын
Glad it was helpful!
@internetdrew Жыл бұрын
There are a lot of great people teaching these subjects but wow you just made that simple. I just built a fullstack app and most the hold up was micromanaging pieces of state. Going to implement useReducer from here forward.
@DaveGrayTeachesCode Жыл бұрын
Glad it was helpful!
@try-b2k Жыл бұрын
I was having problems in learning reducer from a week or so and this video changed evrything, thanx a bunch
@ssj1260 Жыл бұрын
It's gotten to the stage where, if i'm unsure about something I just type in "question + Dave Gray" to youtube. You have no idea how amazing it is to have a reliable source of information, when I was researching closures I came across so much conflicting information, after your video on them I vowed to make sure I looked at your videos as the main source of truth, they are clean, efficient, well explained and professional. Thanks Dave.
@DaveGrayTeachesCode Жыл бұрын
That's the best compliment I could ask for! Thank you! 💯
@jonathanmcgee6546 ай бұрын
Amazing. I was really lost in why and how to transition from useState to useReducer. Dave walks us through it step by step! Great examples and explanations! Thank you!
@DaveGrayTeachesCode6 ай бұрын
Glad it was helpful!
@purushottamkute7485 Жыл бұрын
I'm literally in tears I watched so many tutorials of useReducer but this one is hands down the best one
@verydifferentthought Жыл бұрын
I was really having the problem of Redux stuff... But now I can understand where idea of Reducer came from but also dispatch, action and payload which looks like complicated stuff but after your explanation and I got the whole point of the thing. I am grateful of your amazing work from Uzbekistan !
@DaveGrayTeachesCode Жыл бұрын
You're welcome and hello 👋 to Uzbekistan!
@arungrg Жыл бұрын
Felt so much like small scale Redux. Loved how you explained everything. Great job 👍
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@El_kammex Жыл бұрын
Now I Understand more what we need useReducer hook. Great job.
@BrainAido Жыл бұрын
Buddy i am probably very late, as i now just started my interest in React ( company switched to some React based CRM ) , i came to thank you X milions for putting together this video, i finally understood state and it ticked in my head as now you gave me a visual representantion in my brain, please accept my thanks i wish you the best.
@TrueSQN Жыл бұрын
I'm from Poland, and for explaining word "dispatch" you have my subscription :D love ya lessons
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@felixlutrovnik3458 ай бұрын
must admit, i saw at least 5 videos to understand useReducer hook. the only one that was fully understandable for me was your video ! thank you, and keep your great job at explaining fully professional topics for young devs.
@maxwellosuji40962 жыл бұрын
Thank you very much sir. I’ve been having difficulties learning the useReducer hook. I get more confused reading articles and watching other videos. But thankfully You’ve explained and broken down the what, why and usage of this particular hook. I’m so grateful it’s a thumbs up for me👍
@DaveGrayTeachesCode2 жыл бұрын
Glad it was helpful! 💯
@kaioqrz2 жыл бұрын
Thank you Dave! After so much time trying to understand the useReducer I finally made it! Thank you man!! :D
@DaveGrayTeachesCode2 жыл бұрын
You're welcome! 💯
@stokedonthestoke Жыл бұрын
Thanks so much! Used this before I attempted to use useReducer in my app and then felt way more confident about what I was going to do. Your vidoes are great, really appreciate it. When I have questions about something I try to find a video from you first!
@DaveGrayTeachesCode Жыл бұрын
Great to hear!
@johnforeverrules8 ай бұрын
i don't know whether you will see this comment or not. i just wanted to thank you for making such a high quality, easy to understand tutorial. God bless you sensei.
@vincejones3381 Жыл бұрын
Great example and explanation! I haven’t seen the true value of useReducer until this video and I have been learning React for years.
@flowerofash4439 Жыл бұрын
i lilke the way you explain this, you speak "human" thats rare to have as a programmer and very important for a teacher! subscribed!
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@javadrip Жыл бұрын
Watched many useReducer tutorials and this is the best! Simple, easy to follow and no digressing halfway.
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@MuhammadBilal-ry5rb11 ай бұрын
Thank you so much SIr Dave I believe you are one of the best Programming instructor in the world right now all programming stuff available in your channel for beginners, intermediate and even for experts as well Thank you so much for your efforts and contribution I'm following you from last 1,2 months for ReactJS you are just amazing teacher I found on this platform Huge Love from Pakistan
@codingispower181610 ай бұрын
So true.
@TheLastPhoen1x2 ай бұрын
Oh my god, thank you, I was starting to think I am dumb. But after watching just half of this video I understood the point of a reducer. Not just "how to use a reducer" but WHY use a reducer.
@Andi-rd8yf Жыл бұрын
Exactly what i was looking for, really appreciate your work buddy!
@FitzroydeSilva2 ай бұрын
Very clear, I was struggling to understand the concept of useReducer.
@4t1962 жыл бұрын
This was easy easy to understand. The best useReducer tutorial so far.
@DaveGrayTeachesCode2 жыл бұрын
Glad I could help! 💯
@amancandream Жыл бұрын
Went through a couple videos about useReducer and was about to give up and go back to Vanilla js lol. But you explained things super well!! Thanks so much! Subbed!
@DaveGrayTeachesCode Жыл бұрын
Glad I could help!
@hamzapaskingakhtar10 ай бұрын
Coming here from NetNinja MERN course. I was stuck on the Context part where useReducer was used. This was really a great video. Great teaching, really matches with my way of learning (spoon feeding) :P. Overall, thank you professor.
@DaveGrayTeachesCode10 ай бұрын
Glad it was helpful!
@mtsurov Жыл бұрын
Best explanation so far. Appreciate you making this tutorial.
@DaveGrayTeachesCode Жыл бұрын
Glad it was helpful!
@iidiez872 Жыл бұрын
Best tutorial for useReducer , you made it really easy to understand.
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@ilivetruth7 ай бұрын
Thank you for the video and explanation, much easier to understand than the docs!
@danielconde2729 Жыл бұрын
Excellent explanation! I was so confused using reducer
@DaveGrayTeachesCode Жыл бұрын
Glad it was helpful!
@leoMC43842 жыл бұрын
Great content. I implement useReducer in my project for a form that fetches values from my API to several menus, the user chooses data from the menus and the UI gets updated and the entire form data it's validated at the same time. With useState, it got pretty messy. Now with useReducer it's much better, even though my reducer function got quite long. 😀😀😀
@CottidaeSEA2 жыл бұрын
Thankfully the work in your reducer can also be delegated to separate functions.
@focusroom_ Жыл бұрын
This is THE BEST tutorial for useReducer, tysm!
@DaveGrayTeachesCode Жыл бұрын
You're very welcome!
@dmitriipe4kin8382 жыл бұрын
Man thanks for this video it amazing video, I am from Moldova near Ukraine and my mind full of war between Ukraine and Russian, and I drank 1.5l of beer but when I started wach this video my mind forgot all problems and think about - it amazing and how simple to use it
@DaveGrayTeachesCode2 жыл бұрын
Glad I could help, Tigra! 💯🙏
@syeds8314 Жыл бұрын
Many Thanks for the video!❤ After watching and studying several resources, your video made things clear to me.
@confusedGuenni9 ай бұрын
I finally got it. Well done tutorial, thank you.
@toppmoviehighlights2 жыл бұрын
Actually tried the useReducer hook for the first time yesterday..... This has provided a valuable insight to what useReducer really is. Good job.
@DaveGrayTeachesCode2 жыл бұрын
Thank you! 🙏💯
@ahmedk434510 ай бұрын
best explanation i came across, thanx Dave...keep it up!
@Jawad_Siddiqui2 жыл бұрын
God gifted teacher😀Thanks
@DaveGrayTeachesCode2 жыл бұрын
Thank you for the kind words, Mohammed! 🙏🙏
@mattstopa94366 ай бұрын
Thanks for giving a practical example
@DaveGrayTeachesCode6 ай бұрын
Glad it was helpful!
@abdulazizmashrabov63992 жыл бұрын
Thanks. You are hero. Awesome way of teaching. Hope you make more advanced blogs for react
@DaveGrayTeachesCode2 жыл бұрын
Thank you! 🙏
@adi4057 Жыл бұрын
The best video to understand this concept. Thank man!!!
@DaveGrayTeachesCode Жыл бұрын
You're welcome!
@RS-iy2bm Жыл бұрын
The best tutorial i watched that made it all easy.
@DaveGrayTeachesCode Жыл бұрын
Glad to hear that!
@sadamali66912 жыл бұрын
Waaaw thank you teacher dave greating you from somalia🇸🇴
@DaveGrayTeachesCode2 жыл бұрын
You're welcome, Wiz! And hello to Somalia! 👋
@AndreeaCozariuc2 жыл бұрын
Dave, you are a blessing. Thank you ❤🔥
@DaveGrayTeachesCode2 жыл бұрын
You're welcome!
@barreg17 Жыл бұрын
I finally understood it. Massive thank you!
@DaveGrayTeachesCode Жыл бұрын
Glad it helped!
@umairqamar26722 жыл бұрын
this is super duper amazing. Thank you Dave
@DaveGrayTeachesCode2 жыл бұрын
You're welcome, Umair!
@hannah51238 Жыл бұрын
This is such a great explanation of useReducer! Thanks very much Dave 😍
@randomtalks5253 Жыл бұрын
You are simply Love!! Such a great video. Helped me alot. Clear toThePoint conCise and compreHensive❤
@Un0Real3332 жыл бұрын
Just brilliant! I did so much refactoring and made my code look better and more reusable, after watching your videos, keep up the good work!
@DaveGrayTeachesCode2 жыл бұрын
I'm glad I could help!
@broomybroomybroomy2 жыл бұрын
Man, thanks so much for explaining how to update multiple object properties in the same statement. I was pulling my hair out trying to figure out how to do what you did with the spread operator. I was changing one thing with useState and it was wiping out everything else in the object
@DaveGrayTeachesCode2 жыл бұрын
Glad it helped! 💯
@dranix5018 Жыл бұрын
Very clear and well explained! Thanks.
@DaveGrayTeachesCode Жыл бұрын
Glad it was helpful!
@neo90sr2 жыл бұрын
Very nice explanation. I had some trouble understanding this, but now it's all clear
@DaveGrayTeachesCode2 жыл бұрын
Great to hear! 💯🚀
@harisharris5902 Жыл бұрын
Watched this topic on Udemy course, got so confused there 😖, but your explanation is superb! You have lovely tone to your voice I could listen you for hours!
@DaveGrayTeachesCode Жыл бұрын
Glad it helped and thank you for the kind words! 🙏
@OnlyPlayStation5 Жыл бұрын
The best video I watched for usereducer, can you please do all react hooks
@DaveGrayTeachesCode Жыл бұрын
Thank you! My React Hooks playlist has most: kzbin.info/aero/PL0Zuz27SZ-6PSdiQpSxO9zxvB0ns6m3ta
@anaslaraki2 жыл бұрын
the best tutorial on the topic
@DaveGrayTeachesCode2 жыл бұрын
Thank you! 🙏
@masruralam61992 жыл бұрын
How clear explanation, I ever found. Thanks Dave Gray..
@DaveGrayTeachesCode2 жыл бұрын
You're welcome! 💯
@JedOpeningThings2 жыл бұрын
Thank you! This is prolly the cleanest and best video for the useReducer hook I can find!
@DaveGrayTeachesCode2 жыл бұрын
Glad it was helpful! 💯🙏
@clevercoderjoy Жыл бұрын
wow this has been so helpful I was able to implement this in my project
@DaveGrayTeachesCode Жыл бұрын
Glad to hear that!
@joseff59982 жыл бұрын
Thank you so much Dave! I was really trying to understand the use Reducer. This was so clear!
@DaveGrayTeachesCode2 жыл бұрын
Glad I could help, Josef!
@BabaNoami2 жыл бұрын
Thanks. Very clear explanation. My first real intro to useReducer. Looking forward to putting it into practice.
@DaveGrayTeachesCode2 жыл бұрын
You're welcome, Noam 🙏💯
@gogas28602 жыл бұрын
Wow, the best explanation of usereducer hook, I've ever watched. Thank you very much!!!
@DaveGrayTeachesCode2 жыл бұрын
You're welcome! 💯
@Pareshbpatel2 жыл бұрын
The benefits of deploying the useReducer Hook, so beautifully and succinctly described. Thank you, Dave {2022-04-11}, {2022-08-02}
@DaveGrayTeachesCode2 жыл бұрын
You're welcome, Paresh! 🙏
@AvinashSingh-ts1cn2 жыл бұрын
Thanks a ton for sharing your knowledge. I am now a subscriber to your channel and found some other best videos. Thanks a lot man
@DaveGrayTeachesCode2 жыл бұрын
You're welcome! 💯
@SimPwear842 жыл бұрын
Nicely explained! Short, sweet and straight to the point. Thank you
@DaveGrayTeachesCode2 жыл бұрын
Thank you! 💯
@jamshidtashkent1976 Жыл бұрын
Thank you Dave. It is really cool
@DaveGrayTeachesCode Жыл бұрын
You're welcome!
@shayanfaghihi2 жыл бұрын
Wow! You rocked it; Thanks Dave for this super and comprehensive video. I watch the very first second of the video, and I could run the app by myself. The rest was for better understanding 😉
@DaveGrayTeachesCode2 жыл бұрын
You're welcome, Shayan!
@muhammedozalp Жыл бұрын
Thank you bro. This is a very good tutorial.
@fabricio-garcia Жыл бұрын
What a great way to teach concepts! Subscribed to the channel already.
@DaveGrayTeachesCode Жыл бұрын
Welcome aboard!
@prankurpandeyy2 жыл бұрын
Been struggling on this topic for a month now i will first make all things in usestate , then covert all that into reducer
@DaveGrayTeachesCode2 жыл бұрын
Good plan! It will help you understand the difference 💯
@benarcher3722 жыл бұрын
Excellent. Now I know what to replace Redux with in my small projects.
@DaveGrayTeachesCode2 жыл бұрын
Right on Ben! 💯
@ebesquin Жыл бұрын
Thank you so much. As always a great tutorial
@DaveGrayTeachesCode Жыл бұрын
You're welcome!
@wahhaab72 жыл бұрын
Thx a lot, finally understood this
@DaveGrayTeachesCode2 жыл бұрын
Glad it helped! 💯
@ihateorangecat2 жыл бұрын
this is the video that i learnt useReducer hook and i equipped the knowledge to making a todo app all by useReducer without using useState. thanks!🙌
@DaveGrayTeachesCode2 жыл бұрын
Great to hear! 💯
@ashharkausar4132 жыл бұрын
Instructive as always. Wish I had seen this video earlier it would've made my code much more optimal!
@DaveGrayTeachesCode2 жыл бұрын
Glad it was helpful!
@Programming16210 ай бұрын
thank you very much you saved my time
@tomnewton31912 жыл бұрын
Great video, very clearly explained. Thanks, Tom
@DaveGrayTeachesCode2 жыл бұрын
You're welcome, Tom!
@juhairahamed53422 жыл бұрын
Good explanation related useReducer
@DaveGrayTeachesCode2 жыл бұрын
Happy to help!
@fatbubble1232 жыл бұрын
So the idea is to withdraw perfectly good functional programming and instead opt for additional boilerplate code? Great tutorial. This really helps me to understand use reducer. This is well made and informative.
@DaveGrayTeachesCode2 жыл бұрын
Glad it helped out!
@kamaboko12 жыл бұрын
Great video. Subscribed!
@DaveGrayTeachesCode2 жыл бұрын
Thank you! 💯
@phucwall1212 жыл бұрын
Thank you so much Dave
@DaveGrayTeachesCode2 жыл бұрын
You're welcome!
@sdfsdfsdffdsfsdfsd1232 жыл бұрын
very well explained as always. THANK YOU
@DaveGrayTeachesCode2 жыл бұрын
You are welcome! 💯
@gezafiqrullah53212 жыл бұрын
thank you mr.dave :)
@DaveGrayTeachesCode2 жыл бұрын
Welcome!
@ahmedmohned3872 жыл бұрын
Thank you very much for this wonderful tutorial.
@DaveGrayTeachesCode2 жыл бұрын
You're very welcome! 💯
@abdallahazouz59482 жыл бұрын
nice explanation ...thanks for helping me :D
@DaveGrayTeachesCode2 жыл бұрын
You're welcome!
@THEJOAMS Жыл бұрын
That helps me a lot 🙏
@DaveGrayTeachesCode Жыл бұрын
Glad to hear it!
@filippocamagni2 жыл бұрын
Brilliant! Thank you so much!
@DaveGrayTeachesCode2 жыл бұрын
You're welcome! 💯
@djelasrca8091 Жыл бұрын
Thank you for greath explanation
@DaveGrayTeachesCode Жыл бұрын
You are welcome!
@pedrojunior45162 жыл бұрын
Great tutorial.
@DaveGrayTeachesCode2 жыл бұрын
Thank you!
@nikwotten18042 жыл бұрын
thank you dave
@DaveGrayTeachesCode2 жыл бұрын
You're welcome!
@sonamohialdin33762 жыл бұрын
Awesome tutorial
@DaveGrayTeachesCode2 жыл бұрын
Glad you liked it! 💯
@sonamohialdin33762 жыл бұрын
@@DaveGrayTeachesCode Thank you
@Scorpion2321-o9o2 жыл бұрын
I mean the concept is all good, but it's annoying using three different change methods to just change the state that could be done with just addToogle((prevState) => !prevState) or addToogle(false/true). But I know that in huge projects you could have a way better overview of your state changes with useReducer rather than with useState. I already looked over the redux project, maybe you could do something with Typescript and React as well, to get an idea of Types in JS. The Videos are great and help me a lot, in school and on personal projects, I appreciate this kind of knowledge that is provided one click away, keep going 👍. And I like the side notes that you give, such as ,,Read the documentation is also a skill that you need" and so on.