Тёмный

ReactJS Tutorial - 11 - setState 

Codevolution
Подписаться 649 тыс.
Просмотров 742 тыс.
50% 1

📘 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

Опубликовано:

 

25 ноя 2018

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 356   
@charlesbeadle7313
@charlesbeadle7313 5 лет назад
This whole series is perhaps the best React series that I’ve seen. I like how you’re showing one way, and then another way.. so it is apparent how each change effects whatever you’re doing. That’s very effective for me. Thank you!
@adamnoah121
@adamnoah121 4 года назад
I was just about to comment the same thing. The other tutorials were just spitting out lines of code barely explaining what everything does leaving me with some basic app and me still clueless to what I did and back at square one. I actually have a full understanding of state and props now.
@laponiec
@laponiec 3 года назад
@@adamnoah121 I feel exactly the same.
@devsaranga
@devsaranga 4 года назад
Vishwaas you're an amazing teacher. You know how to structure a course and deliver content very well without causing any confusion in the learner's mind. I'm currently on this video and I don't intend to leave my room until I watch the entire series. Thank You so much.
@tannerbarcelos6880
@tannerbarcelos6880 4 года назад
The best react series anywhere, really. If you read the docs in conjunction to each of these videos, you learn very swiftly. These examples demonstrate the core react/JS fundamentals. Thus is great!
@nataliaduran8051
@nataliaduran8051 4 года назад
Hi guys, I will leave this here, just in case it could help someone: In the last example, he wrapped in parentheses everything after the "=>" ...I searched for that and found the following: "Using arrow functions with object literals: If you are returning an object literal, it needs to be wrapped in parentheses. This forces the interpreter to evaluate what is inside the parentheses, and the object literal is returned ( example: x => ({ y: x }) )"
@afekhaijoseph5678
@afekhaijoseph5678 4 года назад
Wow.....I came to the comment section looking for answer to this..and here comes an angel...thank you
@namansamra255
@namansamra255 4 года назад
thanks , i came here to look that .
@deeproy7292
@deeproy7292 4 года назад
thanks @Natalia
@nehalhyder8515
@nehalhyder8515 4 года назад
Thanks a lot @Natalia.Came here to find the answer for this only
@Himanshu_Sharma..
@Himanshu_Sharma.. 4 года назад
You saved my day nat thank you very much
@adarshtiwari7395
@adarshtiwari7395 2 года назад
Hello Vishwas... Loving this series so far! I love the way you teach and leave no stones unturned while explaining a concept... Thank You V!
@SumanDas-fx5vu
@SumanDas-fx5vu 4 года назад
I think, probably you are the best teacher on youTube for react. The way you explain each and every concept is really amazing.
@rohitrai4215
@rohitrai4215 5 лет назад
I like how you create various scenarios to demonstrate important react concepts.
@TheDima23
@TheDima23 4 года назад
this has to be one of the best React Tutorial playlists i've seen thank you so much for the content !
@marvinfok65
@marvinfok65 2 года назад
One of the best React lessons in RU-vid! Clear and easy to understand!
@Seaspray127
@Seaspray127 Год назад
You are a good instructor. A lot of these tutorials give the imporession they are just an experienced programmer showing off. You break down the steps to the level of a beginner React student who doesn't tune into the gobblede goop technical explanations that would make sense to an advanced programmer looking at a single function. Thank you for making this course.
@altuno
@altuno 2 года назад
Seriously the best explanation available on this subject, even compared to paid courses. Thank you so much!
@lopyus
@lopyus 5 лет назад
The quality of these videos are superb, just look at the like to dislike ratio
@toannew
@toannew 3 года назад
0:25 extension ES7 React of Visual Sudio code 4:59 why we should never modify the state directly: the state.count is changed only in console, but not in screen (react does not re-render the component) 9:11: what if we want to execute some code after the state has been changed: use call back function. 11:00 pass afunction to the setState 13:54: summary about setState
@mohammadalisakib6565
@mohammadalisakib6565 3 года назад
oww dude, You are really amazing
@oscarmdiaz
@oscarmdiaz 3 года назад
I am seeing so many good reviews about the course. I have to add my two cents. This is absolutely....phenomenal. Vishwa does a great job, lays out everything so well in manageable size chunks. Thank you very much for putting this together.
@SyamKumarVoleti
@SyamKumarVoleti 5 лет назад
Thanks alot for your valuable time and effort in making these videos.
@peterhodgman981
@peterhodgman981 4 года назад
Extremely well put together tutorial. You have set the gold standard.
@girlandhercomputer7204
@girlandhercomputer7204 4 года назад
THank you a ton, u are the only one explaning so explicitly setState() the second parameter and when/why to use it(after I watched 4 other tutorials with more subs and view counts), u should get more subs! also repost in another video
@nvHumanist
@nvHumanist 2 года назад
This is the kind of tutorial, I was looking for. Its a great place to learn new languages. Thanks a lot Vishwas!
@ze_chooch
@ze_chooch 3 года назад
I'm really enjoying your series. Thank you so much.
@LetCode96666
@LetCode96666 4 года назад
All I ever wanted from you was to click on the INCREMENT button more than once :(
@AnkurKumar-ur1cj
@AnkurKumar-ur1cj 4 года назад
I am losing my mind cause how correct you are.
@ManjunathManja1227
@ManjunathManja1227 3 года назад
😭
@rajeswarynarasimman3728
@rajeswarynarasimman3728 4 года назад
That cleared a lot of things for me. Thanks for the tutorial bro!!!
@jinxcab2682
@jinxcab2682 3 года назад
A very thorough explanation thanx a lot. I understand react simply because of your tutorial. A million thanks 👏👏👏
@MrMoggz
@MrMoggz 2 года назад
Just wanted to say thankyou for this amazing series !
@3swayam
@3swayam 4 года назад
codevolution this is amazing. very simple and structured !!
@ajayrathod7438
@ajayrathod7438 3 года назад
This React series is best as can and I an thankful too you. In frist two videos I had my doubts but now I have no doubt.
@yajnasenipanda7697
@yajnasenipanda7697 4 года назад
Watching your videos. I must say you are really really amazing teacher. You present really well. Good luck
@pinakadhara7650
@pinakadhara7650 4 года назад
Amazing! You are such a great teacher
@sanatanShishya1521
@sanatanShishya1521 4 месяца назад
Very thankfull to your videos, following complete playlist and feeling like more confident then ever. Still 2024, these videos are working for us. Thank you 🙏
@quenotelocuenten1859
@quenotelocuenten1859 4 года назад
I like your way of speaking, it is slow and it helps me understand a little better since I don't have much knowledge of the language
@citranodi
@citranodi 2 года назад
I liked your video. Very instructive and easy to understand.
@zakariyyamaqsood7662
@zakariyyamaqsood7662 Год назад
This series is a true gem! I've been watching it in January 2023, even after 4 years, it still holds up. I commend the effort and dedication you put into making these videos. Keep up the fantastic work!
@amitshaw193
@amitshaw193 Год назад
Did you completed the series?
@zakariyyamaqsood7662
@zakariyyamaqsood7662 Год назад
@@amitshaw193 yes
@AboudASalam
@AboudASalam 11 месяцев назад
but ppl and companies don't use class functions that much nowadays , u sure it's ok to watch the course ?
@littlewonder8641
@littlewonder8641 Год назад
Your teaching style is fantastic and awesome. My standing ovation for this course.
@NaveenRawat51
@NaveenRawat51 5 лет назад
you are the best Vishwas!!
@darkblack7351
@darkblack7351 4 года назад
Your explanations are better than online courses
@mdmasud5888
@mdmasud5888 4 года назад
I've pressed the like button three times👍👍👍. your video helps me a lot to learn react quickly
@amitgiri6895
@amitgiri6895 2 года назад
loved the content and the way you explained with do's and dont's❤❤👏👏👏👏
@juhandvan
@juhandvan 5 лет назад
This is very helpful!. Thank you so much :)
@manjunathgudipati5183
@manjunathgudipati5183 4 года назад
I am fan of your course. thanks for your teaching.
@jonascaluwe7804
@jonascaluwe7804 4 года назад
In stead of executing your code in the callback function which can get cluttered, you can also make your increment function an async function by placing the async keyword in front and placing the await keyword in front of this.setState(...); This way you can organize your code better. Nice series btw. Keep up the good work!
@pampabanerjee8754
@pampabanerjee8754 Год назад
Your explaination is awesome.Helping me lot to understand react concept.
@kirankamath5891
@kirankamath5891 3 года назад
Thanks , i didn't knew about 2nd parameter in setstate which is a callback function that helps in using modified state value .
@koushikhalder1579
@koushikhalder1579 Год назад
Thanks to vishwas, ur knowledge help me to do my office project. Thank You
@huanshao2165
@huanshao2165 4 года назад
best React tutorial! Thanks!
@Phantom1037
@Phantom1037 3 года назад
This is great stuff!! Thank you so much for this!!
@ChillCityNaveen
@ChillCityNaveen 4 года назад
Very detailed explanation about each concept much appreciated....:)
@biishtplease
@biishtplease 3 года назад
took 1hr to completely understand this 15 min video.. worth it
@ronaldmelendez7814
@ronaldmelendez7814 3 года назад
prevState is defined by the setState function. So basically if you add a function to the setState method the argument for the function enter in the setState method is automatically the previous state. It's not predefined by the programmer, it is defined by the setState function.
@machavaramakhil6656
@machavaramakhil6656 3 года назад
can you explain it another way, what I understood is that when we try to use a function as recursion call we need to use prevState right?
@tejalbhavsar4610
@tejalbhavsar4610 3 года назад
great series you covered everything and details
@imtiazkabir6115
@imtiazkabir6115 4 года назад
do not understand how the prevState value is updated when passing through setState method
@3Digga
@3Digga 4 года назад
This is my issue too.
@utkarshagrawal3640
@utkarshagrawal3640 3 года назад
Dude basically setState method can take either of the two arguments (a funtion or an object) .. if u decide to pass a func as an arg than u can update the prevState or if u give obj as an arg than u r simply overwriting the prevState!
@Rahulverma-zt3sx
@Rahulverma-zt3sx 3 года назад
you are the best teacher in the world.
@ismailenegadi2506
@ismailenegadi2506 Год назад
thank you for this beautiful content 😍😍😍
@anoopp227
@anoopp227 4 года назад
Thankyou for your amazing tutorials
@prnk139
@prnk139 4 года назад
very well explained. much better than any udemy course :-)
@OrincyWhyteDesigns
@OrincyWhyteDesigns 2 года назад
I def have to rewatch this one
@vanchungle5504
@vanchungle5504 Год назад
Great video tutorials!
@prisinha
@prisinha 2 года назад
3:00 within render method in class type component we call object named as this state along with its key named as count
@baibhavghimire6576
@baibhavghimire6576 4 года назад
You are amazing man..Thanks for these free million dollar stuffs
@sthitaprajnamishra9831
@sthitaprajnamishra9831 4 года назад
550 likes vs 3 dislikes. Brilliant quality and highly underrated!
@raziyasulthana3177
@raziyasulthana3177 3 года назад
Sir ur teaching is simply superb and nice explanation
@danielEpifanov
@danielEpifanov 4 года назад
thank you so much man, I subscribed
@rahulnag9582
@rahulnag9582 5 лет назад
Awesome videos brother....thank you soo mcuh
@rafijlouis2432
@rafijlouis2432 4 года назад
Which extension are you using which makes the arrows in arrow function looks like a perfect arrow rather than like =>
@mohdatique9429
@mohdatique9429 4 года назад
Hello apart from the context can we create the separate jsx file with all common imports because it increasing the length of files. Please do reply .
@dadasajad8741
@dadasajad8741 11 месяцев назад
Sir, you are the best.
@zhiyongtey6372
@zhiyongtey6372 3 года назад
Hi, I come to the incrementFive() method and realized it does the work even without changing from the object literal to the function call. Is there any update on this?
@itgiants5218
@itgiants5218 2 года назад
Well Explained thank youuuuuuuuu so much !
@jsampat761
@jsampat761 5 лет назад
Simply u r great!
@mohanapriyac6451
@mohanapriyac6451 2 года назад
very informative thanks!!!
@vaibsify
@vaibsify 2 года назад
awesome explanation 🙏
@letzzvibe
@letzzvibe 4 года назад
It is really helpful. Thanks.
@jokeropbro9867
@jokeropbro9867 Год назад
Thankyou Great Course
@phokhaing6521
@phokhaing6521 4 года назад
I like your tutorial. Thanks
@LeonnardoNascimento
@LeonnardoNascimento 2 года назад
awesome video!
@rajbannasa7662
@rajbannasa7662 2 года назад
Thank you so much sir ❤️
@thantzinwin7215
@thantzinwin7215 Год назад
I feel I chose the right channel for React Tutorial
@manjunathgudipati5183
@manjunathgudipati5183 4 года назад
Hi Vishwas.. i got one doubt for this setState concpt. after using class using Constructor and super method in brackets mentioned Props. actually constructor uses to initialize the classes right. why will use props in bracket. i observed now i removed props in bracket. then i got same output. what is the difference between that.
@betaninerniner6165
@betaninerniner6165 4 года назад
Why did we pass in props in the constructor? Can you please explain that part. I know that it is a default by the snippets library. But which is the case where we definitely need to put them in, as in this case, we could have directly ignored them.
@musheer495
@musheer495 Месяц назад
It's 2024 and we do not use Classes as much anymore. Focus on functional components and hooks, as they are the future and present of React. However, having a basic understanding of class components is still valuable for working with older codebases and gaining a well-rounded knowledge of React.
@yuliasilber2123
@yuliasilber2123 2 года назад
Super! Thanks 😊
@hanumanwange9533
@hanumanwange9533 2 года назад
Best react series
@pratikgaikwad688
@pratikgaikwad688 2 года назад
Hi guys, even I was confused about the prevState but since he spoke about passing function as args I tried below and it works: prevState() { //function to return currentState value return this.state.count; } increment() { this.setState(prevState => ({ //use abv function to get current value count: prevState.count + 1})) console.log(this.state.count) } Hope this helps and I'm a beginner too so feel free to correct me if any mistake
@ioannisventouzis
@ioannisventouzis 3 года назад
The series is absolutely perfect.. Congratulations. Regarding the setState, I have the following concern that it is not clear to me so far. As mentioned in the video the calls to setState are asynchronous and if console.log not included as a callback function the result is one less than the actual state. If this is true how the render method {this.state.count} lists the correct state and not one less?
@vigneshgvs
@vigneshgvs 2 года назад
man u r a legend! u r saying the method prototype structure clearly. setState (object, callback). has disadvantage, so we will use setState(function, callback). Wow and you clearly explained console logs wont be in sync, unless kept in callback (which took me a day to find, luckily reached ur utube video). 1. only 1 big 'div tag in render 2. setState({count: this.state.count+1}) - updates value on screen. this.state = this.state - wont work. - modifying the state directly 3. Calls to setState are asynchrous ie; but console old value - to make it in sync - use in callback func of setState. ie; entire usage of that variable in that file must be inside setState method so that it gets updated value… 4. whenever gonna access prev value of a state and gonna update, always pass a "function with prevState" as 1st parameter, instead of an "object" - like an increment If this method called many times, still value will be increased only once. For this not happen, need to pass previous state as a parameter and in a function. (4th point)
@Finn-jp6pn
@Finn-jp6pn 4 года назад
Thank you! Thank you! Thank you!
@alsan8935
@alsan8935 4 года назад
Great video...Thanks!
@codescript201
@codescript201 3 года назад
Why we are using this in increment function can we use only increment()?
@MdBulbulAhmed
@MdBulbulAhmed 5 лет назад
amazing work...thanks.
@shoumikrouf7952
@shoumikrouf7952 Год назад
cool tutorials bro
@arunprasad8261
@arunprasad8261 5 лет назад
In spite of writing call back function we can also write code as count:this. state.count+=1. It also gives same response.
@almuntasirabir4511
@almuntasirabir4511 4 года назад
@ 1:36 how does the < counter > attribute changes to jsx syntax . Does any one know?
@moderncloth682
@moderncloth682 3 года назад
I love you Vishwazzz. Peace be upon thee, broov.
@Aditya.Santra
@Aditya.Santra 2 года назад
Amazing Video
@sainathy9225
@sainathy9225 3 года назад
@Codevolution how to edit state partially meaning only to update few state variables?
@6977202865
@6977202865 4 года назад
you doing GREAT job thank you!!!!!!!!!!!!!!!!!!!
@overnecros
@overnecros 4 года назад
Im using the component state in the value attribute at input like value={this.state.variable}. In the event change handler im uppercasing the input value. Internally the state value displays at UPPERCASE but the value text at input UI displays lowercase. Can you provide me an example? Please im new
@chitraraval277
@chitraraval277 4 года назад
thank you for react series
@W4lkthroughWizard
@W4lkthroughWizard 9 месяцев назад
Do you need to bind the state if you use no arrow function?
@bidhanroy1038
@bidhanroy1038 4 года назад
Very very good till now.
@ncesar
@ncesar 5 лет назад
Wouldnt doing increment(value){ this.setState( { count: this.state.count + value }, () => { console.log(this.state.count); } ); } and then incrementFive(){ this.increment(5); } also work? Can you explain the difference?
@AM-ey2vn
@AM-ey2vn 5 лет назад
Yep that works fine. There is literally no difference, he used five calls of increment function to visually represent what would happen if you call that function 5 times with the first version of function. Your example works normally and its a shorter solution for this one, he used the "wrong" way just to describe a common beginner mistake.
@lathagm666
@lathagm666 9 месяцев назад
completed 11th Video. Thank you 🙂
Далее
ReactJS Tutorial - 12 - Destructuring props and state
4:45
Why Signals Are Better Than React Hooks
16:30
Просмотров 464 тыс.
No one will play with him( #standoff #meme #grenade
00:12
ReactJS Tutorial - 13 - Event Handling
7:36
Просмотров 649 тыс.
71 - React JS - setState, local state
35:45
Просмотров 55 тыс.
5 JavaScript Concepts You HAVE TO KNOW
9:38
Просмотров 1,4 млн
ReactJS Tutorial - 10 - State
10:35
Просмотров 878 тыс.
You might not need useEffect() ...
21:45
Просмотров 154 тыс.
React Tutorial for Beginners
1:20:04
Просмотров 2,8 млн
Top 6 React Hook Mistakes Beginners Make
21:18
Просмотров 564 тыс.