React Hooks Tutorial - 25 - useState vs useReducer

  Рет қаралды 122,823

Codevolution

Codevolution

5 жыл бұрын

📘 Courses - learn.codevolution.dev/
💖 Support UPI - support.codevolution.dev/
💖 Support PayPal - www.paypal.me/Codevolution
💾 Github - github.com/gopinav
📱 Follow Codevolution
+ Twitter - / codevolutionweb
+ Facebook - / codevolutionweb
📫 Business - codevolution.business@gmail.com
useState vs useReducer

Пікірлер: 69
@ericxu7023
@ericxu7023 3 жыл бұрын
I would say you are a way better tutor than 99% of the Udemy tutors out there with their paid tutorials. Thank God that you are blessed with such a talent in interpreting complex concepts and also the passionate and kind heart to share all your knowledge so selflessly!Can't even express how grateful and lucky I feel to find your KZbin channel. Best wishes to you and your family! I Will definitely continue to support your own website whenever there is new content!
@exodion4173
@exodion4173 3 жыл бұрын
Same. Idk why i was unable to find this channel up until like 4 days ago haha
@HARIHaran-ks7wp
@HARIHaran-ks7wp 2 жыл бұрын
same...so glad i found him, otherwise i would have never understood hooks :P next stop...REDUX playlist!
@Enigmata23
@Enigmata23 Жыл бұрын
I agree 100% man. I literally came here after halfway through an udemy React course and I realized I had no idea what I was doing. This guy taught me React in a few days better than a paid course.
@jgv4945
@jgv4945 4 жыл бұрын
Whenever a question comes up to my mind you are already giving the answer. Best tutor i found so far.
@Powerful-Manifestor-
@Powerful-Manifestor- 2 жыл бұрын
Same here!
@wahoobeans
@wahoobeans 4 жыл бұрын
great work. i binge watched this entire playlist.
@rauluis
@rauluis 3 жыл бұрын
Mood, need that motivation
@jonaskolton9122
@jonaskolton9122 2 жыл бұрын
sorry to be offtopic but does any of you know of a way to get back into an Instagram account..? I was stupid forgot the account password. I would appreciate any tips you can give me
@irachristian8797
@irachristian8797 2 жыл бұрын
@Jonas Kolton instablaster =)
@jonaskolton9122
@jonaskolton9122 2 жыл бұрын
@Ira Christian thanks so much for your reply. I got to the site thru google and im trying it out atm. I see it takes a while so I will reply here later when my account password hopefully is recovered.
@jonaskolton9122
@jonaskolton9122 2 жыл бұрын
@Ira Christian it did the trick and I finally got access to my account again. Im so happy:D Thanks so much you saved my account !
@rafik.arif.83
@rafik.arif.83 2 жыл бұрын
You are really beyond excellent at explaining complex stuff. Thank you very much.
@greatnwamadi20
@greatnwamadi20 2 жыл бұрын
Thank you so much for simplifying the useReducer hook and making it much easy to understand. i always thought it was so difficult but i am glad you proved me wrong
@theresashen1327
@theresashen1327 2 жыл бұрын
You are really the best React teacher way better than all the ones on Udemy! Thank you so much for making this tutorial!
@balakumars9754
@balakumars9754 3 жыл бұрын
Great work, i become fan of you, Thanks a lot for helping me understanding in a simpler way.
@prnk139
@prnk139 4 жыл бұрын
Excellent !! Hope i will also become like you some day !!
@RedzSR
@RedzSR Жыл бұрын
Have you done it ??
@AbhishekKumar-mq1tt
@AbhishekKumar-mq1tt 5 жыл бұрын
Thank u for this awesome video and series
@HaoLe-cm4hg
@HaoLe-cm4hg 3 жыл бұрын
Hi sir, your tutorials are extremely good. Thank you very much! Could you make series about the Authorization for ReactJs, please ❤
@polymorphyson
@polymorphyson 3 жыл бұрын
Your videos are well explained.
@braigetori
@braigetori 2 жыл бұрын
you are a true Teacher
@AliNormukhamedov
@AliNormukhamedov 5 жыл бұрын
THANK YOU VERY MUCH !!!!!
@ashishnayak2666
@ashishnayak2666 2 жыл бұрын
love this channel..god bless you my friend
@aamersohail8181
@aamersohail8181 2 жыл бұрын
You help a lot mate.
@sebastianchaca00
@sebastianchaca00 3 жыл бұрын
Thanks for this videos !!!
@leo-fv2nv
@leo-fv2nv 2 жыл бұрын
Thanks for these videos
@VishalSharma-rn7mt
@VishalSharma-rn7mt 3 жыл бұрын
Awesome, explanation
@kristijanlazarev
@kristijanlazarev 9 ай бұрын
Beautiful!
@enrico1317
@enrico1317 4 жыл бұрын
Thank You very much!!!!!
@mohabashraf4264
@mohabashraf4264 3 жыл бұрын
good work !!
@taufeekahmadkhan3953
@taufeekahmadkhan3953 3 жыл бұрын
You're just awesome!!!!!
@rajadastidar3765
@rajadastidar3765 3 жыл бұрын
You are a life saver
@alisiraj2100
@alisiraj2100 4 жыл бұрын
Well explained
@much_love
@much_love 3 жыл бұрын
THANKS
@matteol1778
@matteol1778 3 жыл бұрын
This video doesn't have subtitles :( Why? By the way, great job as always. This course is fire!
@danielchazan4011
@danielchazan4011 5 жыл бұрын
great 10x
@SimoneRnS
@SimoneRnS 3 жыл бұрын
september 2020 here ;)
@leg875
@leg875 4 жыл бұрын
useReducer looks similar to the reducer in a redux application. So, useReducer is it used in a non-redux application ?
@kaypakaipa8559
@kaypakaipa8559 4 жыл бұрын
Hi thats what im wondering. I use redux in all my apps. From this it seems there is no need to use redux, the setup seems much simpler too.
@markgalante862
@markgalante862 4 жыл бұрын
@@kaypakaipa8559, imagine needing more than one reducers for an application. You'll need to wrap the code in more and more provider tags (which can be quite cumbersome). Redux allows you to store many reducers in a single reducer which is passed into your typical "index.js" of a React set-up. That's the beauty of Redux.
@christianlisangola9383
@christianlisangola9383 2 жыл бұрын
Thank you for the video.But for the 3 first ones, we can use "useState" by storing state into an object like const [{isLoading,isError,isIdle,data},setState]=useState(()=>({isLoading:false,isError:false,isIdle:true,data:null})) to avoid a lot of transitions.And for update, using setState({...}).Also with React 18, the batch update feature will prevent from the transitions problem, and for the 3 first cases we can use useReducer or useState.For the 2 last once, when we combine all this with the context API,i think you are right but, there are also ways to use useState in a very effecient way.This is really an matter of opinion,experience and practice.English isn't my first language, so understand the mistkes.
@shivamsalame
@shivamsalame 2 жыл бұрын
He recorded the video when react 18 didn't came
@christianlisangola9383
@christianlisangola9383 2 жыл бұрын
@@shivamsalame what I’ve written is not specific for React 18
@shivamsalame
@shivamsalame 2 жыл бұрын
@@christianlisangola9383 yeah i respect your answer.
@prnk139
@prnk139 2 жыл бұрын
i want to become like you !
@yadusolparterre
@yadusolparterre 2 жыл бұрын
So if you understand useReducer, you are always better off choosing useReducer over useState, am I right?
@belqisshida5345
@belqisshida5345 4 жыл бұрын
Which is faster and performant while both works for us? 1. useState 2. useReducer
@conaxliu9677
@conaxliu9677 4 жыл бұрын
I remember in one of the videos, it was mentioned that useState is built upon useReducer.
@TheGryphon14
@TheGryphon14 3 жыл бұрын
don't bother about micro-optimization. Unless it's a real bottleneck
@Jason-uv5tm
@Jason-uv5tm 3 жыл бұрын
@@conaxliu9677 yes, useState is just an abstraction built upon useReducer I believe
@adilsheikh9916
@adilsheikh9916 6 ай бұрын
I still don't understand that why should I use any of these? Why can't I export my own object having state & behavior both & then import it to use in any component.
@manjunathjadhav3062
@manjunathjadhav3062 4 жыл бұрын
when to use useReducer? u said useState -> number, boolean, string useReducer-> array or object but using useState (useEffect) v can fetch array/object too then y to use useReducer?
@flashfs
@flashfs 4 жыл бұрын
I think the guidelines were generic. You can use useState and never use useReducer, if you want to, because both solve the same problem. But I think that what he wanted to teach was that with complex objects, useReducer would be a better approach.
@sachiiinnnn9734
@sachiiinnnn9734 3 жыл бұрын
@@flashfs i see you everywhere(almost in every video) clearing doubts of people!! Vishwas got a helping hand here
@liewweijun6728
@liewweijun6728 3 жыл бұрын
can someone please brief the meaning of related state transitions and business logic? I will appreciate it.
@exodion4173
@exodion4173 3 жыл бұрын
Related state transitions mean things that change together. For example, in our previous video, we saw that once we got the data from the endpoint, the loading state, error state, and the post state all changed together. I'm not sure about business logic myself.
@pankajjoshi6658
@pankajjoshi6658 3 жыл бұрын
Local state Vs Global State. How a state can be local, it is always Global right? If i am defining const [state, setState] = useState('') this state is always global. Am i correct or missing something?
@KarthikRaja-bq7pk
@KarthikRaja-bq7pk 3 жыл бұрын
The scope of useState will be only within the particular functional component. Other components cannot access it. Hence local state. But if it is created at the top most level(like app.js) and passed to other components using useContext, that state becomes global, as it can be shared and modified by any components inside the main components tree. This scenario is covered in video #22 in React hooks tutorial. Watch that and you will surely understand
@rahulvirat7859
@rahulvirat7859 3 жыл бұрын
Bro create playlists about "React Helmet" for SEO purpose then your channel get 1million subscriber beleive me...
@taufeekahmadkhan3953
@taufeekahmadkhan3953 3 жыл бұрын
while(true){ return "Thanks!!!!!!!!!!! "; }
@adrienmbiandji8282
@adrienmbiandji8282 5 жыл бұрын
Am confusing on how To use hooks spécialy useReducer, useContext and redux
@venkatramtaddi8696
@venkatramtaddi8696 5 жыл бұрын
The very purpose of useReducer is to avoid using redux. We can achieve all the functionality of redux with the effective use of useState, useReducer, useEffect and useContext
@kaypakaipa8559
@kaypakaipa8559 4 жыл бұрын
UseReducer is to avoid using redux. Its the same concept, but the setup process of redux is a pain. UseReducer is much simpler
@MrAKGarg007
@MrAKGarg007 4 жыл бұрын
Please try to include prevVideo, next Video and series link. Sometimes, it gets hard to find them.
React Hooks Tutorial - 26 - useCallback Hook
15:26
Codevolution
Рет қаралды 310 М.
ALL React Hooks Explained in 12 Minutes
12:21
Code Bootcamp
Рет қаралды 90 М.
Can You Draw A PERFECTLY Dotted Line?
00:55
Stokes Twins
Рет қаралды 82 МЛН
Must-have gadget for every toilet! 🤩 #gadget
00:27
GiGaZoom
Рет қаралды 11 МЛН
Learn React useReducer Hook with Examples
14:19
Lama Dev
Рет қаралды 169 М.
What is the difference between React useState and useReducer?
5:55
Web Dev Cody
Рет қаралды 4,1 М.
Why I Don’t Use useEffect In My React Components
9:30
Web Dev Simplified
Рет қаралды 251 М.
Redux or Context in React
6:16
Ben Awad
Рет қаралды 98 М.
10 React Hooks Explained // Plus Build your own from Scratch
13:15
Fireship
Рет қаралды 1,3 МЛН
Comprendre le hook useReducer de React
35:51
Atomic React
Рет қаралды 4,8 М.
Every Beginner React Developer Makes This Mistake With State
6:37
Web Dev Simplified
Рет қаралды 215 М.
React Hooks useContext Tutorial (Storing a User)
11:38
Ben Awad
Рет қаралды 357 М.
Can You Draw A PERFECTLY Dotted Line?
00:55
Stokes Twins
Рет қаралды 82 МЛН