useReducer is BETTER than useState | React Hook useReducer Tutorial

preview_player
Показать описание

If you are building React apps with multiple state values to keep track of, your React apps need the useReducer hook! In this useReducer React Hook tutorial, you will learn how to apply useReducer to manage the state of your apps.

useReducer is BETTER than useState | React Hook useReducer Tutorial

(00:00) Intro
(00:12) Welcome and Overview
(01:05) useReducer vs useState
(01:53) Initializing useReducer
(03:33) Creating the reducer function
(05:42) Using dispatch and updating JSX
(07:12) Moving all state and handling an action payload
(08:25) An easy mistake to make
(10:01) Displaying state values in JSX
(12:44) Recommended: Action object lookup and dot notation

🔗 ES7 React JS Snippets Extension for VS Code:

🔗 React Dev Tools Extension for Chrome:

📚 References:

✅ Follow Me:

Was this tutorial about the React hook useReducer helpful? If so, please share. Let me know your thoughts in the comments.

#usereducer #react #hooks
Рекомендации по теме
Комментарии
Автор

Showing how its similar to useState and rewriting it using useReducer makes it so much more clear! Thank you!

minimumtn
Автор

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!

andrews
Автор

the best tutorial for useReducer, super clear and simple to understand, what a teacher!

jingli
Автор

What a great and easy-to-get explanation for a pretty confusing topic. Excellent work, thanks Dave!

pablocodeglia
Автор

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👍

maxwellosuji
Автор

Exactly what i was looking for, really appreciate your work buddy!

Andi-rdyf
Автор

I was having problems in learning reducer from a week or so and this video changed evrything, thanx a bunch

try-bk
Автор

Many Thanks for the video!❤
After watching and studying several resources, your video made things clear to me.

syeds
Автор

Best tutorial and explanation I found - thank you Dave!

zb
Автор

I'm literally in tears I watched so many tutorials of useReducer but this one is hands down the best one

purushottamkute
Автор

Thanks man, your explanation is superb! Keep up the good work.

xungngo
Автор

best explanation i came across, thanx Dave...keep it up!

ahmedk
Автор

Thank you Dave! After so much time trying to understand the useReducer I finally made it! Thank you man!! :D

kaioqrz
Автор

Great example and explanation! I haven’t seen the true value of useReducer until this video and I have been learning React for years.

vincejones
Автор

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!

stokedonthestoke
Автор

Nicely explained! Short, sweet and straight to the point. Thank you

SimPwear
Автор

Thank you so much Dave! I was really trying to understand the use Reducer. This was so clear!

joseff
Автор

This is such a great explanation of useReducer! Thanks very much Dave 😍

hannah
Автор

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.

SagarKumar-dbxy
Автор

Thank you for the video and explanation, much easier to understand than the docs!

ilivetruth