Hope you enjoyed the video! I also have a really cool and unique course that will teach you way more than this video. You'll learn how to build an actual complex project with React. It's called "Project React" and you can find it at cosden.solutions/project-react. Also, I have a free weekly newsletter called "Import React" with tutorials, news, and cool stuff about React! You can sign up at cosden.solutions/newsletter?s=ytc
You're an awesome teacher, i legit paused a complicated redux tutorial i was watching yesterday when i saw your post notification for this one and i'm glad i did. Great work bro
@@cosdensolutions you’re welcome! I don’t know if you have tutorials on NextJs but if you don’t pls consider making one. Your style of teaching is really great and easy to follow along🫡
@@cosdensolutions Hi @cosdensolutions @cosdensolutions ,Thanks . As you said , if redux copy the whole state and update the modified proerty in the copied state and replace the while orginal state , my doubt is , do we get performance issue , if our application has more state variable ?
great video. I've always liked and tried to use redux toolkit since the first time I came across it! I have one question though, I'm planning to add redux toolkit to deal with states in the react application I'm working on but it's not completely clear how to deal with HTTP responses from the backend services, what I mean by that is: let's picture a scenario where I call a service layer/endpoint from inside the async thunk action, is it ok for me to just return its response back to the JSX component that dispatched that action? or is it better if I simply use its response and deal with it inside the redux slice and use states to update the user interface (with a toast error message, let's say)? (consider that I'm not using RTK query to deal with HTTP requests, instead I'm gonna have a service layer with classes that will receive a axios instance and then make the HTTP calls)
Tried like 4-5 courses last 2 days trying to understand everything not withing 4 hours long course, and it seems that this one solved all my wonders about Redux. Thank you man, I appreciate that much
Literally I am building my tech stack based on your videos You teached React query i learned it You teached Cypress i learned it Now you teached redux with RTK ofcource i will add that too
haha damn, great to hear! The next step is to know and understand which tools to choose for which project, as some might be better suited for specific use cases!
Absolutely, amazing. 'Complete Tutorial' is perfect match for your video. You literally talk about everything we can use redux-toolkit in a real project right now. Thanks 👍
Redux lovers are stuck in builder which looks like 2007 construction of some sort of pseudocode lol, everything cool in video till java stringbuilder appeared xpp
I don't like Redux man because of its over-complexity, I understand the core concept of it which is cool to me but this naahh let's try react-query(tan-stack) lil better than this(still trying). I feel, for the sake of making things simpler or well structured we went too far. 😶🌫
Why do you need to use async functionality in Redux - why can't you just have your own async handler as per usual and when that completes the promise, call the dispatch? E.g. if you need to fetch data and store that in state, why not use an async function to fetch the data and after the await you use the dispatch with the data as the payload to the normal sync redux reducer? Or is Redux not capable of the dispatch being used in an async action like I have described or are there other reasons not to do this? Because this is how state is normally managed - do the data fetch and await it and then update the state - why do we need to do this differently when it comes to Redux?
Apart from the great explanation, the fact that some people seems to think this "paradign" is cool blows my mind. Am i the only one who thinks this is overcomplicated for no reason ?
once you call the increment and decrement "actions" and once u call them "reducers". Which one is it? Aren't actions dispatched by the dispatch() function, so how can they be reducers? And how come a action takes as an argument a action? Honestly I'm confused.
You explain really cool but i can't understand why do you use typescript because if people are looking for videos about react I do not think that they know typescript including me
Thank you for this video. U certainly did explain quite clearly how RTK works and the best thing is, u even included how to work with typescript and thunks, which so far I've not seen other videos do. My opinion after watching this, and also after reading what Dan Abramov wrote (what somebody above me said), is that sometimes we will still need redux for the fact that the native Context API does not sufficiently cover all use cases for state management. Therefore knowledge of redux is still good to have in 2023/2024 🙂
yeah totally, Redux is still valuable and will be for a long time. There are a ton of new projects choosing to use it daily because it's really good. Imo context isn't good enough to cover most state management use cases. You really need a dedicated library for that!
This is probably the only video on RU-vid which explains how to use redux toolkit with Typescript clearly. I just subscribed and am looking forward to more of your content in the future!
@@cosdensolutions next video should be "Why you dont need to use Redux in 2024". Even Dan Abramov, one of the creators of redux, writes in his twitter that we almost always should not use redux. And its true. Lol, this video is a waste of time, sorry @cosdensolutions
@@gubatenkov companies still use Redux, and have applications built with Redux, so you'll need to know it for jobs even if you don't use it in a new application
00:05 - "wow, what a promise! sure his tutorial will include entities and a basic integration with an API."" 33:25 - "ooo... yes yes yes, here it comes.." 36:30 - "yes, yes... indeed you promise, repeating your promise, and ended up this tutorial with the reminder of your promise. Unfortunately, none of those reflects this promise fulfillment. thanks anyway. I'll go find some Redux Toolkit tutorials that will fulfill my expectations without even promising me anything in advance. thanks anyway.. p.s. I'm sure that there's a good reason for the fact that you have so many subscribers. They will probably trust you even in the next time that you'll promise them something. Good luck!
Thank you alot. I used to code with Angular and had to learn the redux equivalent. I watched a few videos but all of them are really bad. This video explained it so simple
Official document says Immer package which helps allow to write in a mutation way is already included in the createSlice(). 'state.value += 1' will be interpreted as 'return { ...state, value: state.value + 1}'
video creator: This is the last ever video you will need to watch for redux (I promise) redux: changes something. video creator: Here is a new last ever video you will need to watch for redux (I promise)
Your course really helped a lot to know the redux/toolkit and RTK, But I'm facing some challenge to convert app code along with redux/toolkit to ES5, because application must support on IE mdoe in Edge browser, Kindly, express your thoughts on this challenge
Honestly, coming from a Vue.js background and using Pinia for state management, this is an absolute mess to me. I don't understand why React with Redux is the leading JS framework when Vue.js with Pinia is easily superior while being simpler and more user friendly. I can do all of this with much less code, cleaner and more readable. Redux is a huge step down.
Some suggestions 1. you should've shown the actual reducer function 2. not a real world problem. Counter app is useless. 3. Describe why the action name get 'couner/' prefix for 'counter/increment', 'counter/decrement' etc
If I am not mistaken and having looked at the video it seems it seems the async functions are living inside the slice files which in my opinion is mixing up concerns. I think I prefer to keep the store state separate from network calls. i.e. I prefer doing this: const validProofs = await getProofs(); dispatch(homeUpdateProofs(proofs)); I do however appreciate that that using the createAsyncThunk() hook allows one to update state variables with values like pending.
hello! your tutorial is very useful, I love your explanations about many things!) thank you for your work! do you have any tutorial about middleware in redux?
I like your keyboard. Apparently it is an async keyboard, returning a Promise of the correct code in the near future 😂 Thanks for the tutorial, it was very helpful.
Why all official documentations are so useless.. i dont even understand after reading redux's documentation many times.. but after watching this, im mastered redux in one go..
Been using RTK for the better part of the year, with it all being a bit hazy in my head, mostly using RTK Query and the caching! You’ve just mind blown me with this basic, but very clear, tutorial. I the spirit of the store and data fetching. Do you think you could make a video on persisting the data? (Unless you’ve already got one on your channel!) thanks a bunch, plus, I no longer feel alone with keyboard typing issues! 🤪
hahaha the keyboard typing!! Yes I might look into persisting the data with redux, I think it's as simple as using redux-persist but might be worth for a tutorial!
I don't understand why people say in the commends that he explains things really easily, he didn't explain a lot of things, and if you are like me and you need to understand deeply this video is not for you, for example he talks about useSelector and all he sais about it "this is a hook it comes from redux so it needs prentesis" -_- what sort of explanation is that ...
Hi ,Thanks for the video , its very clear and easy to understand teh concept . As you said , if redux copy the whole state and update the modified proerty in the copied state and replace the while orginal state , my doubt is , do we get performance issue , if our application has more state variable ?
Hi ,Thanks for the video , its very clear and easy to understand teh concept . as you said , if redux copy the whole state and update the modified proerty in the copied state and replace the while orginal state , my doubt is , do we get performance issue , if our application has more state variable ?
Thanks for the video, Sir. This was very clear and easy to follow. You've now earned yourself a new Subscriber! I'm looking forward to watching other topics you cover around React.
Once again, I very much appreciate your instruction and all the time you're pouring in to these. If I may offer a piece of constructive criticism... being completely new to redux... I felt a bit like the slow kid at the back of the class who was too afraid to raise his hand and say, "....ummm.... what?" You clearly know your stuff, but I got a bit lost at points. Trying to figure out why... I think you go a lot faster on this one than you do with some of your others. Personally I also love copilot, but maybe it goes by too quick? I'm guessing you're on turbo because that's your normal operating speed and there's a mountain of stuff to get through. Redux toolkit seems like it's doing a lot of heavy lifting and black-boxing quite a lot. I can certainly treat this as a sort of template to copy, but without understanding what's really happening, I know I'll be very stuck when stuff invariably breaks. Don't get me wrong, I don't expect you to cover every little thing in great detail. I just wanted to pass on a little feedback on behalf of anyone else who may have felt like a dunce. :)
Thanks for the feedback! I'm actually in the process of figuring out my teaching style and I'm a bit confused tbh. So I may seem different in some videos because I'm trying to improve hahaha Regarding what you said, I think that's totally normal. RTK does do a lot behind the scenes that you wouldn't know if you've never used Redux without it. If you did, then you know all of the things it solves for you. But honestly, for most use cases, even if just learning as a beginner, you should follow this as a template and trust that it works, and with time you'll understand how it works behind the scenes. Redux specifically is a complex topic and I didn't want to go too deep into it as it would overwhelm both me and beginners. The goal is to get you started with the basics, and then you take it on from there over time. Also, fair point with copilot. I always try to make sure that if I use it for a suggestion that I spend the time to explain what it did, but it might be too much for complete beginners so I understand. Watching my own videos sometimes I'm like hmm that may have been too fast. It's quite tough to make these videos, but I'm striving to do better all the time so thanks a lot for the feedback!
All you explained really works, Thank You! - this is an excellent explanation. But why do we have to use this Redux approach instead of a significantly simpler one with "useContext" hook. Just a simple question: WHY or FOR WHAT? :) Could you or someone else please explain? Thanks!
For simple state, useContext is fine. But as the app grows and you have many states everywhere and need functions and selectors, it's easier to do it in Redux because it was built for that
Great video, explained everything in a easy yet straight forward way. Been able to implement Redux for the first time in a simple Todo app just by watching your video. Thanks again!
This would be helpful to see. I'm still a little lost in when to use pending etc. The text that appeared before he quickly deleted it said something about showing a loading indicator.
First of all, thanks for the great tutorial! I'm really enjoying your content. By the way, which keyboard are you using in this video? It sounds awesome! (hope you got used to it 😂)
thnx buddy! the latest update of redux made all the past tutorials very hard to follow and I was stuck on this for the last 2 days, your video did a fabulous job of explaining the builder❤❤