useReducer is BETTER than useState | React Hook useReducer Tutorial

  Рет қаралды 64,771

Dave Gray

Dave Gray

Күн бұрын

Пікірлер: 288
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
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
@Tajdev
@Tajdev 2 жыл бұрын
You have not demonstrated how to pass it to component. Please also make video of it.
@m1dway
@m1dway Жыл бұрын
@@Tajdev just pass it in an input parameter. Ex:
@andrews13
@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
@DaveGrayTeachesCode Жыл бұрын
Glad I could help!
@jingli9232
@jingli9232 Жыл бұрын
the best tutorial for useReducer, super clear and simple to understand, what a teacher!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad it was helpful!
@pablocodeglia
@pablocodeglia 2 жыл бұрын
What a great and easy-to-get explanation for a pretty confusing topic. Excellent work, thanks Dave!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad it was helpful!
@SagarKumar-db2xy
@SagarKumar-db2xy 2 жыл бұрын
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.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you, Sagar! I appreciate the request, too. I do need to post some projects. 🙏💯
@minimumt3n204
@minimumt3n204 Жыл бұрын
Showing how its similar to useState and rewriting it using useReducer makes it so much more clear! Thank you!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You're welcome!
@zb2747
@zb2747 Жыл бұрын
Best tutorial and explanation I found - thank you Dave!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad it was helpful!
@internetdrew
@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
@DaveGrayTeachesCode Жыл бұрын
Glad it was helpful!
@try-b2k
@try-b2k Жыл бұрын
I was having problems in learning reducer from a week or so and this video changed evrything, thanx a bunch
@ssj1260
@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
@DaveGrayTeachesCode Жыл бұрын
That's the best compliment I could ask for! Thank you! 💯
@jonathanmcgee654
@jonathanmcgee654 6 ай бұрын
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!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 6 ай бұрын
Glad it was helpful!
@purushottamkute7485
@purushottamkute7485 Жыл бұрын
I'm literally in tears I watched so many tutorials of useReducer but this one is hands down the best one
@verydifferentthought
@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
@DaveGrayTeachesCode Жыл бұрын
You're welcome and hello 👋 to Uzbekistan!
@arungrg
@arungrg Жыл бұрын
Felt so much like small scale Redux. Loved how you explained everything. Great job 👍
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@El_kammex
@El_kammex Жыл бұрын
Now I Understand more what we need useReducer hook. Great job.
@BrainAido
@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
@TrueSQN Жыл бұрын
I'm from Poland, and for explaining word "dispatch" you have my subscription :D love ya lessons
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@felixlutrovnik345
@felixlutrovnik345 8 ай бұрын
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.
@maxwellosuji4096
@maxwellosuji4096 2 жыл бұрын
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👍
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad it was helpful! 💯
@kaioqrz
@kaioqrz 2 жыл бұрын
Thank you Dave! After so much time trying to understand the useReducer I finally made it! Thank you man!! :D
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome! 💯
@stokedonthestoke
@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
@DaveGrayTeachesCode Жыл бұрын
Great to hear!
@johnforeverrules
@johnforeverrules 8 ай бұрын
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
@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
@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
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@javadrip
@javadrip Жыл бұрын
Watched many useReducer tutorials and this is the best! Simple, easy to follow and no digressing halfway.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@MuhammadBilal-ry5rb
@MuhammadBilal-ry5rb 11 ай бұрын
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
@codingispower1816
@codingispower1816 10 ай бұрын
So true.
@Andi-rd8yf
@Andi-rd8yf Жыл бұрын
Exactly what i was looking for, really appreciate your work buddy!
@FitzroydeSilva
@FitzroydeSilva 2 ай бұрын
Very clear, I was struggling to understand the concept of useReducer.
@4t196
@4t196 2 жыл бұрын
This was easy easy to understand. The best useReducer tutorial so far.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad I could help! 💯
@amancandream
@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
@DaveGrayTeachesCode Жыл бұрын
Glad I could help!
@hamzapaskingakhtar
@hamzapaskingakhtar 10 ай бұрын
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.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 10 ай бұрын
Glad it was helpful!
@mtsurov
@mtsurov Жыл бұрын
Best explanation so far. Appreciate you making this tutorial.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad it was helpful!
@iidiez872
@iidiez872 Жыл бұрын
Best tutorial for useReducer , you made it really easy to understand.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@ilivetruth
@ilivetruth 7 ай бұрын
Thank you for the video and explanation, much easier to understand than the docs!
@danielconde2729
@danielconde2729 Жыл бұрын
Excellent explanation! I was so confused using reducer
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad it was helpful!
@leoMC4384
@leoMC4384 2 жыл бұрын
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. 😀😀😀
@CottidaeSEA
@CottidaeSEA 2 жыл бұрын
Thankfully the work in your reducer can also be delegated to separate functions.
@focusroom_
@focusroom_ Жыл бұрын
This is THE BEST tutorial for useReducer, tysm!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You're very welcome!
@dmitriipe4kin838
@dmitriipe4kin838 2 жыл бұрын
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
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad I could help, Tigra! 💯🙏
@syeds8314
@syeds8314 Жыл бұрын
Many Thanks for the video!❤ After watching and studying several resources, your video made things clear to me.
@confusedGuenni
@confusedGuenni 9 ай бұрын
I finally got it. Well done tutorial, thank you.
@toppmoviehighlights
@toppmoviehighlights 2 жыл бұрын
Actually tried the useReducer hook for the first time yesterday..... This has provided a valuable insight to what useReducer really is. Good job.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you! 🙏💯
@ahmedk4345
@ahmedk4345 10 ай бұрын
best explanation i came across, thanx Dave...keep it up!
@Jawad_Siddiqui
@Jawad_Siddiqui 2 жыл бұрын
God gifted teacher😀Thanks
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you for the kind words, Mohammed! 🙏🙏
@mattstopa9436
@mattstopa9436 6 ай бұрын
Thanks for giving a practical example
@DaveGrayTeachesCode
@DaveGrayTeachesCode 6 ай бұрын
Glad it was helpful!
@abdulazizmashrabov6399
@abdulazizmashrabov6399 2 жыл бұрын
Thanks. You are hero. Awesome way of teaching. Hope you make more advanced blogs for react
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you! 🙏
@adi4057
@adi4057 Жыл бұрын
The best video to understand this concept. Thank man!!!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You're welcome!
@RS-iy2bm
@RS-iy2bm Жыл бұрын
The best tutorial i watched that made it all easy.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad to hear that!
@sadamali6691
@sadamali6691 2 жыл бұрын
Waaaw thank you teacher dave greating you from somalia🇸🇴
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome, Wiz! And hello to Somalia! 👋
@AndreeaCozariuc
@AndreeaCozariuc 2 жыл бұрын
Dave, you are a blessing. Thank you ❤‍🔥
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome!
@barreg17
@barreg17 Жыл бұрын
I finally understood it. Massive thank you!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad it helped!
@umairqamar2672
@umairqamar2672 2 жыл бұрын
this is super duper amazing. Thank you Dave
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome, Umair!
@hannah51238
@hannah51238 Жыл бұрын
This is such a great explanation of useReducer! Thanks very much Dave 😍
@randomtalks5253
@randomtalks5253 Жыл бұрын
You are simply Love!! Such a great video. Helped me alot. Clear toThePoint conCise and compreHensive❤
@Un0Real333
@Un0Real333 2 жыл бұрын
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!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
I'm glad I could help!
@broomybroomybroomy
@broomybroomybroomy 2 жыл бұрын
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
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad it helped! 💯
@dranix5018
@dranix5018 Жыл бұрын
Very clear and well explained! Thanks.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad it was helpful!
@neo90sr
@neo90sr 2 жыл бұрын
Very nice explanation. I had some trouble understanding this, but now it's all clear
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Great to hear! 💯🚀
@harisharris5902
@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
@DaveGrayTeachesCode Жыл бұрын
Glad it helped and thank you for the kind words! 🙏
@OnlyPlayStation5
@OnlyPlayStation5 Жыл бұрын
The best video I watched for usereducer, can you please do all react hooks
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you! My React Hooks playlist has most: kzbin.info/aero/PL0Zuz27SZ-6PSdiQpSxO9zxvB0ns6m3ta
@anaslaraki
@anaslaraki 2 жыл бұрын
the best tutorial on the topic
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you! 🙏
@JedOpeningThings
@JedOpeningThings 2 жыл бұрын
Thank you! This is prolly the cleanest and best video for the useReducer hook I can find!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad it was helpful! 💯🙏
@clevercoderjoy
@clevercoderjoy Жыл бұрын
wow this has been so helpful I was able to implement this in my project
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad to hear that!
@joseff5998
@joseff5998 2 жыл бұрын
Thank you so much Dave! I was really trying to understand the use Reducer. This was so clear!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad I could help, Josef!
@BabaNoami
@BabaNoami 2 жыл бұрын
Thanks. Very clear explanation. My first real intro to useReducer. Looking forward to putting it into practice.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome, Noam 🙏💯
@gogas2860
@gogas2860 2 жыл бұрын
Wow, the best explanation of usereducer hook, I've ever watched. Thank you very much!!!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome! 💯
@Pareshbpatel
@Pareshbpatel 2 жыл бұрын
The benefits of deploying the useReducer Hook, so beautifully and succinctly described. Thank you, Dave {2022-04-11}, {2022-08-02}
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome, Paresh! 🙏
@AvinashSingh-ts1cn
@AvinashSingh-ts1cn 2 жыл бұрын
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
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome! 💯
@SimPwear84
@SimPwear84 2 жыл бұрын
Nicely explained! Short, sweet and straight to the point. Thank you
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you! 💯
@jamshidtashkent1976
@jamshidtashkent1976 Жыл бұрын
Thank you Dave. It is really cool
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You're welcome!
@shayanfaghihi
@shayanfaghihi 2 жыл бұрын
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 😉
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome, Shayan!
@muhammedozalp
@muhammedozalp Жыл бұрын
Thank you bro. This is a very good tutorial.
@fabricio-garcia
@fabricio-garcia Жыл бұрын
What a great way to teach concepts! Subscribed to the channel already.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Welcome aboard!
@prankurpandeyy
@prankurpandeyy 2 жыл бұрын
Been struggling on this topic for a month now i will first make all things in usestate , then covert all that into reducer
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Good plan! It will help you understand the difference 💯
@benarcher372
@benarcher372 2 жыл бұрын
Excellent. Now I know what to replace Redux with in my small projects.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Right on Ben! 💯
@ebesquin
@ebesquin Жыл бұрын
Thank you so much. As always a great tutorial
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You're welcome!
@wahhaab7
@wahhaab7 2 жыл бұрын
Thx a lot, finally understood this
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad it helped! 💯
@ashharkausar413
@ashharkausar413 2 жыл бұрын
Instructive as always. Wish I had seen this video earlier it would've made my code much more optimal!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad it was helpful!
@Programming162
@Programming162 10 ай бұрын
thank you very much you saved my time
@ihateorangecat
@ihateorangecat 2 жыл бұрын
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!🙌
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Great to hear! 💯
@tomnewton3191
@tomnewton3191 2 жыл бұрын
Great video, very clearly explained. Thanks, Tom
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome, Tom!
@juhairahamed5342
@juhairahamed5342 2 жыл бұрын
Good explanation related useReducer
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Happy to help!
@fatbubble123
@fatbubble123 2 жыл бұрын
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.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad it helped out!
@kamaboko1
@kamaboko1 2 жыл бұрын
Great video. Subscribed!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you! 💯
@phucwall121
@phucwall121 2 жыл бұрын
Thank you so much Dave
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome!
@sdfsdfsdffdsfsdfsd123
@sdfsdfsdffdsfsdfsd123 2 жыл бұрын
very well explained as always. THANK YOU
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You are welcome! 💯
@gezafiqrullah5321
@gezafiqrullah5321 2 жыл бұрын
thank you mr.dave :)
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Welcome!
@ahmedmohned387
@ahmedmohned387 2 жыл бұрын
Thank you very much for this wonderful tutorial.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're very welcome! 💯
@abdallahazouz5948
@abdallahazouz5948 2 жыл бұрын
nice explanation ...thanks for helping me :D
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome!
@THEJOAMS
@THEJOAMS Жыл бұрын
That helps me a lot 🙏
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad to hear it!
@filippocamagni
@filippocamagni 2 жыл бұрын
Brilliant! Thank you so much!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome! 💯
@djelasrca8091
@djelasrca8091 Жыл бұрын
Thank you for greath explanation
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You are welcome!
@pedrojunior4516
@pedrojunior4516 2 жыл бұрын
Great tutorial.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you!
@nikwotten1804
@nikwotten1804 2 жыл бұрын
thank you dave
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome!
@sonamohialdin3376
@sonamohialdin3376 2 жыл бұрын
Awesome tutorial
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad you liked it! 💯
@sonamohialdin3376
@sonamohialdin3376 2 жыл бұрын
@@DaveGrayTeachesCode Thank you
@Scorpion2321-o9o
@Scorpion2321-o9o 2 жыл бұрын
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.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you for the feedback! 💯
@engiuser-m7p
@engiuser-m7p Жыл бұрын
Wow! Thankyou!!!!!
@cleancode2123
@cleancode2123 2 жыл бұрын
Nice explanation of useReducer. 🙏
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you!
@m.ahsani0076
@m.ahsani0076 2 жыл бұрын
thanks this works for me
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome!
@oncoding4520
@oncoding4520 Жыл бұрын
its funny I was looking for this concept since 2 days ago.... of course I found out your video bcs I have seen another videos and i Know you are a great teacher but somehow I felt it naaahhhh maybe Dave will complicate this bcs you go through the concept and I will go confused. So lets see Dave another time.... and searching through the KZbin i saw a lot of videos and they were ok but didnt go now on more deep :D LOOOl so when I was opening you video i remember that on some video they didnt update the state with their previous state when they did the counter and I know that you have a video how to update counter from previous state and I was thinking... "those guys are wrong :D I know this thing for sure"... so opened your video since in the beginning I know that you update your useState correctly (lool) so i though OK am gonna watch Dave now... So as always spent to much time comparing and i understood this concept perfectly from you hahah after missing some hours :)))
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad you made it back! 💯🚀
@harag9
@harag9 11 ай бұрын
Great vid Dave, many thanks for this. Just a couple quick questions, but I'll have a play anyway. 1. I take it when you despatch(xxx) that then does a rerender just like if you do setColor(true) 2. useEffect - if I wanted to fire off some code when the count changes I would use setCount(23) and then add a dependency on the useEffect to maybe fire off an API. Is it the same here, would we just put state.count in the useEffect dependency ?
useLayoutEffect vs useEffect | React Hooks Tutorial
5:16
Dave Gray
Рет қаралды 13 М.
Learn React useReducer Hook with Examples
14:19
Lama Dev
Рет қаралды 176 М.
Will A Guitar Boat Hold My Weight?
00:20
MrBeast
Рет қаралды 238 МЛН
Как мы играем в игры 😂
00:20
МЯТНАЯ ФАНТА
Рет қаралды 3,1 МЛН
Learn React Hooks: useReducer - Simply Explained!
13:48
Cosden Solutions
Рет қаралды 59 М.
Stop Doing this as a React Developer
12:27
CoderOne
Рет қаралды 163 М.
Context API in react | get the concept
29:00
Hitesh Choudhary
Рет қаралды 58 М.
6 State Mistakes Every Junior React Developer Makes
15:53
Lama Dev
Рет қаралды 267 М.
useReducer Hook - React In Depth
55:25
Tech with Nader
Рет қаралды 1,5 М.
State Managers Are Making Your Code Worse In React
13:33
Web Dev Simplified
Рет қаралды 185 М.
Will A Guitar Boat Hold My Weight?
00:20
MrBeast
Рет қаралды 238 МЛН