Introduction to React #11 | useReducer

preview_player
Показать описание
We learn how to use the useReducer hook instead of the useState hook to store data.

Hope you folks enjoy this!
👉 If you enjoy this video, please like it and share it.

💢 Watch our other videos:

Thank you for watching this video, click the "SUBSCRIBE" button for stay connected with this channel.

#javascript #reactjs
Рекомендации по теме
Комментарии
Автор

I just realised I have failed a test code interview with a very similar approach on the same topic literally 3 days ago. My code was not so clean as yours... I had no time to fine grain the FE, as they also required a BE with protected routes and registration... I wish I have seen your content earlier haha.

KriszX
Автор

Came over via Traversy Media where he presented your Design Patterns video. Excellent. Subscribed.

rogerparrett
Автор

Looking forward to watching more videos on state management, your way of explaining concepts is incredibly clear, and production quality is top notch :)

JibJabJoo
Автор

Your videos are so professional and high quality. Need more react stuffs

ShahnewazTameem
Автор

One suggestion (something I wish instructor YouTubers would do but I haven't seen it done before): provide a link to the full course playlist in the video description. Because of the way that YT works, if a video is clicked to from content that YT recommends (including from your other videos), it won't show the context of the playlist that it's a part of.

This requires the viewer to drill into your profile in order to discover it, which can take time and involve a bit of guesswork. It's a bit of an annoyance that YT doesn't offer this service to content creators, but to get around that, I feel like adding playlist links in your descriptions would be a good way to provide your viewers with an easy way to discover more of your content and may even help with your channel growth -- which you absolutely deserve.

Anyway just my $0.02. Thanks!

chrisperry
Автор

How do you handle deeper level property updates? Do you just spread the state at every level?

Also, do you think that it's better to just get the state/dispatch from the context in every component that needs it or should we just get it at a parent level and pass it down as props?

nikolaprijovic
Автор

High quality content as always, love it

KaranPratapSingh
Автор

Hi Jack. I've followed your entire Introduction to React course. As a Vue dev, it's been an excellent source of knowledge. One thing I absolutely love about the Vue ecosystem is Vuex. Will you be making a video on Redux? That would be great.

Alekobeats
Автор

I didn't get the difference between using a reducer and having a single useState that stores an object as the state. I will be able to manipulate the members of the object independently just as i can with the reduce and with setState I will also have the previous state, so what's the point of having a reducer? Am I missing something here?
Thanks for the great content!

elementotriplo
Автор

Hi, is there an argument that useContext and useReducer are nearly anti patterns? They break the single responsibility principle by as now components are view generation with state management (and even data loading in your example). If you used redux (I know the set up and initial boilerplate is a pain) you get to separate all state management from our components (move data loading to thunks), leaving them with one responsibility, rendering (and wiring up events to passed props.) With redux, following the ducks pattern, and using connect files to isolate the state and state management. You can pass to your components just the state data they need (mapStateToProps) and the actions they should perform (mergeStateToProps do bind dispatch to simple functions). Leaving you with no props drilling, no state management in components, just pure clean html.

notted
Автор

can you do a video on how to do a combineReducer(redux) using useReducer(react hooks)

edetmmekut