Why I Love useReducer
HTML-код
- Опубликовано: 28 апр 2019
- React Hooks have been out for a couple of months now. I’ve had the chance to play with them during that time and recently found an amazing example of where the useReducer Hook really shines.
I was so excited about how much stronger useReducer made my components that I had to share it with you.
Have a watch and let me know if you also love useReducer!
------
BLOG POST: hswolff.com/blog/why-i-love-u...
SOURCE CODE: github.com/hswolff/youtube/tr...
PATREON: / hswolff
TWITTER: / hswolff
SITE: hswolff.com/ Наука
Thanks for watching everyone! I'm glad you're as excited about useReducer as I am!
If you like the video and want to keep supporting more of it please consider becoming a Patreon supporter! Every little bit helps! ❤️ www.patreon.com/hswolff
This video just changed my life. I literally thought the whole reducer/dispatch usage was complicated and made no sense. YOU ARE A KUNG FOO TEACHER! This makes things much more DECLARATIVE and not so IMPERATIVE!
Hahahahahah thank you! So glad it clicked for you!
Totally agree. I was just about to dismiss reducer/dispatch as unnecessary, and I am so glad that I came across this video. Subscribe!
I totaly agree :))
Okay this is best explanation of useReducer I've found on internet.
Probably the best video I've seen on this. You're a great teacher and explain stuff well! Thanks Harry :)
Wonderful! So lovely to hear, thank you!
The best explanation i ever heard, you explaining is like take our hand and explaining step by step 😂 so cool
Wow, great explanation of the hook and a really detailed but quick run through the thought process of developing this UI. Subbed!
This is one of the best explanations for useReducer that I have found! Thanks :)
Thanks so much for one of the clearest explanations and demos I've seen on this - you are an excellent teacher!
Just loved your enthusiasm and vibe for programming! Keep rockin!!!
Great video, and really well explained. Thank you for taking the time to make this.
Hey Harry - this video really helped me with useReducer. Thank you for taking the time to make it.
This was the best useReducer explanation I've seen on RUclips!
Distinguishing between the user experience and the underlying mechanics necessary for that experience made the use of useReducer so much more intuitive to me, thanks :)
great tutorial, thank you for not tunnelling on the code and actually explaining the flow of things
This was great! Nice short and concise
This is awesome and totally changed how I think about useReducer and handling form inputs. Thanks so much!
Great video. Loved the practical use of useReducer
I keep coming back to this video because to me, it's the best tut on useReducer I have found.
Aww, thanks so much for saying so!
I'm fairly new in React, especially React Native (I've been studying this lib for like 2 months, max) and this video is amazing, gave me a lot of ideas how to manage state properly. Your explanation was on point, I understood everything about the useReducer even being a beginner and not speaking fluent english (I'm from Brazil). Thanks for the video.
Excellent demo Harry, really made the benefits of useReducer clear to me. Thanks!
You are welcome! Glad you enjoyed!
Thanks Harry for this amazing video.
It's been more than two years since this video has been uploaded on youtube, it gives me the answer what I should say about userReducer on my job interview.
Harry, your channel is underrated! I've been struggling to get my head around useReducer for the last days, finding that I understand the standard 'counter' tutorials in the documentation, but as soon I try to use them on forms, I came unstuck. This really helped me to get a MUCH better understanding of how useReducer can be used in more complex ways with inputs/selects and other elements. Thanks so much!
Great explanation. This is essentially how state machines are implemented. And yes, state transitions can get very complicated very quickly. This is exactly what I needed.
What a great example! Thank you
Wow, this is magical! Definitely makes more sense how the functionality of useReducer is used from knowing Redux. This is greatly explained -- thanks for uploading!
Awesome explination! Thanks for the content!
That's a really nice way of thinking about it - it's all about what the user is trying to do, hence 'actions'. 👍🏻
Great explanation! Thanks a lot Harry!
Awesome explanation with a great example. I really learned a lot about useReducer hook.
Thanks Harry. That is a great explanation of how useReducer works and why you would want to use it.
Thanks for the video dude, I combined what I learned from this video and the "Advanced Hooks" video to create an app that serves a login page and a todolist with both being managed by useReducer. Pretty cool!
Woo! That' s so great to hear! Congrats!
Great video Harry. Thanks
This is awesome - your voice on top is crazy addictive :)
You're an incredible teacher! Thank you so much!!
Example was spot on :)
Best explanation that I have heard so far, thank you very much. subbed
you are awesome. have a great experience to watch it
So glad you liked it! Thank you!
Great video, just at the right time when I needed it
Awesome! Glad to hear!
thank you Harry, pretty awesome and clear tutorial...... great time to be using hooks!
Yes, I agree! Glad it helped!
Thank you for making such a really clear content! keep up a good work bro
Thanks for watching!
Excellent video!
Nice, really liked the video. Can't find many such insights online
Amazing video on useReducer 👍👍👍
Great. Nice walk through and explaination!
Thank you!
Thank you Harry !
Great video !!!
this was a fantastic video, it had great pacing and the explanations were top notch. You made thsi very easy to understand. Definitely will be subscribing from this video.
just fell in love with this hook too hahaha. Thanks, Harry.
This video is AWESOME. Really useful!! Thank you : )
This is a great explanation. Thanks
genius! great example now I can understand the reason of using useReducer thanks a lot for this great video
So good!!! Thanks for sharing.
Great video, you made it easy to follow! Thank you!
This is immensely useful. Thank you :)
That's probably the best example of useReducer I have seen so far. I do agree that though longer, it definitely is more maintainable. I coded along and though imperative programming is still more natural to me, it got messy, and useReducer made so much sense. Thanks.
This is the best useReducer explanation on YT. Thanks Harry!
Thank you! Glad it was so helpful!
Nice video bro .You helped clear my confusion of why should i use reducer instead of state.
Great explanation!
This is fantastic. I wrote a production feature that had 10+ useState hooks. It got messy really quick. This is exactly what I need. Thank you for the guide.
Woohoo!! So glad it helped!
This is the best explanation! Subscribed
Love the way that u change from useState to useReducer, really good video!
Thanks!
Very good tutorial. Thanks!
im totally going to try it tomorrow, thanks for the video!
Thanks for watching! I hope the trial goes well!
Great video. Converting over some of the code in my Gatsby site to use UseReducer. Thanks!!
Woohoo! Another happy convert!
This was so great because you showed the "non reducer" part of this code to give context. Like the other comments, I had a nice, big, loud "A HA" moment. Really excellent job, thank you.
thanks for the gem man . This videos is so helpful .
amazing explanation, best teacher
This is brilliant. I’m working on a component that I’ve made needlessly complex. Dispatching based on user behaviour is an extremely helpful mental model. Thank you!
Woot! These are the things I love to hear! So glad it helped!
Great video, thanks!
thank u, I was struggling to understand this, I got confused between useState and useReducer!
I like the way u show how can useReducer do it better & clean way than using useState.
this is the best way to teach
Thank u for this awesome video
Thank you, really excellent tutorial on both React Hooks and Redux.
You are very welcome!
Fantastically explained the useReducer() .... Brilliant !!!!!
Glad it was helpful!
Wow, thanks for showing it with useState first. That made things much more clear. I don't know if I'd understood it without it. Kudos to you.
Tremendous! So glad to hear it!
Thank you for awesome video
your videos are much helpful and make me motivated to study React
liked your explanation!
Amazing video, great job.
Thank you!
Good work. Thanks for contributing to peoples learning.
:)
Very clear and useful, thank you very much!
Hey, thanks! Glad it helped!
Thanks a lot for your time! Although I still find useReducer a complicated hook, watching your video made it less impossible to comprehend
I'll take it!
Wow, this perfectly makes sense. Every tutorial out there only says "This is an alternative to useState" but never mentions why, and the practicality of useReducer. You just answered every skepticism I had about this. Much thanks, I have subscribed -- looking forward to more content!
That's so great to hear! The why is so important!
Damn!! Finally someone explained this in a way I 100% understood!!.... Thank You!! Liked & Subscribed! Can't wait for more from you, great content, example was perfect! really Good stuff
Welcome! Thank you!
12:37 and I thought I was good with keybindings. This is just witchcraft.
Haha 😆 🧙♂️
@@hswolff thats VS Code right? how you do that?
@@strelkan Alt+ctrl to extend your cursor and ctrl+shift to select until ",". I needed to try when i saw this lol
In Mac OS
1. option + Shift and drag down/up to extend the cursor.
2. option + Shift and ⬅️/ ➡️to select text.
3. Then command + c to copy and command + v to paste. 🧙♀️
@@felipealvesj same here and ya thnx 4 this
i really enjoy your content. you're awesome. i also enjoy your humor :)
woooofff, great explanation sir
thanks a lot, it was a very clear a nice explanation
You are a great teacher :)
I love this video. Learned so much from this :)
Man your cool!!! You presented it simpler. I wonder where were you 🤔when I was learning it from scratch.. keep up the good work.
By the way subscribed👍
Love the explanation. Seems like use reducer is a way to make a bunch of state work together. It's like a mega state.
best tutorial for useReducer() hook on RUclips
Been trying to get my head around useReducer recently w/o having any Redux experience. This is super useful man, thanks!
Woo!! Great to hear!
@@hswolff Quick question, is the reducer function (in this case loginReducer) typically put in the same place as the Component the state is used? Was kinda expecting the reducer function to go in a separate folder "reducers" or something, like redux.
It's better to keep it in the same file as the component as that's the only place where it's going to be used. IMO easier to read if it's in the same file. If you want to share it (which is unlikely with useReducer, as it encourages it to be component level) then you could put it into its own file.
@@hswolff you can also make your own custom resusable hooks and dispatch them!
I'm new to react and redux, thanks for sharing this. :)
that field action type is a power move
Spot on!! Thanks
Great tutorial, thanks!
Woo! Thank you!
legendary! a practical example from what is wrong to what is right. Please make a video on React Context with your own words and experience and how it relates to useReducer
Hey even if this for beginners , i enjoyed watching this.
U got a nice soul
great video sir j you rock
Haha, thanks!
this is the best video i've seen ever...so simpler....i loved it....thnks :)
Yay! You're welcome!
Wow. I’m convinced.