Learn to use State in React in 19 minutes (for beginners)

  Рет қаралды 85,405

Sonny Sangha

Sonny Sangha

Күн бұрын

🚨 Join the world’s BEST developer community “Zero to Full Stack Hero”: www.papareact.com/course
📩 Want coding problems (with solutions!) delivered to your inbox daily? www.papareact.com/dailycoding...
This video is designed to get you familiar with the React useState Hook where we cover topics such:
👉 What is the useState Hook?
👉 What does it allow us to do?
👉 Where state is supported!
👉 Build a counter app using state!
🔴 LOOKING FOR THE CODE? 🛠️
links.papareact.com/github
👇🏻FOLLOW ME HERE:
Instagram: links.papareact.com/instagram
Facebook: links.papareact.com/facebook
LinkedIn: links.papareact.com/linkedin
Twitter: links.papareact.com/twitter
Discord: links.papareact.com/discord
Newsletter: links.papareact.com/newsletter
💰 WANT TO SUPPORT THE CHANNEL?
Donate here: links.papareact.com/donate
Grab some PAPA Merch: links.papareact.com/merch
🕐 TIMESTAMPS:
00:00 Intro
00:17 Skillshare Sponsorship
01:57 Introduction to the useState Hook
02:54 Building a counter app using State
05:04 Explaining State
05:51 Implementing the useState Hook
09:20 Non persistent State explanation
09:54 Building counter in a Class Based Component
16:41 Async explanation and demo
18:40 Summary
19:06 Outro
Let’s get it PAPAFAM 🔥.
#react #useState #javascript

Пікірлер: 129
@SonnySangha
@SonnySangha Жыл бұрын
📬Do you want DAILY coding problems sent DIRECTLY to your Inbox? (with solutions the next day) 👉 links.papareact.com/university
@c9m853
@c9m853 2 жыл бұрын
Hi Sonny, i want to thank you from my bottom of my heart. With you and your videos i managed to do my last year license project and got an internship in a web development company . Now i am focusing on working hard and grow. You are awesome, can't wait for your next video.
@avneesh0612
@avneesh0612 2 жыл бұрын
The new intro is sickkk
@eyosiyas_js
@eyosiyas_js 2 жыл бұрын
Yeaaaaaaa
@achtube85
@achtube85 2 жыл бұрын
FINALLY a video that uses a simple example to show how to transition from Class to Functional. This is so freaking useful. Blessed!!!
@jons_RoadtoCode
@jons_RoadtoCode Жыл бұрын
Yes exactlly! what a struggle is been to get this clarified! As someone who spent days on vanilla JS creating a counter app (LOL), I really appreciated how Sonny compared the two. Understanding useState finally clicked for me with this teaching method. Welp, this is my first video watched from Sonnys huge playlist, time to apply what I've learned and then check out some more :)
@itsgojoverfr
@itsgojoverfr 10 ай бұрын
@@jons_RoadtoCode hey jons it's been 6 months, have you landed a job or are you still learning?
@jons_RoadtoCode
@jons_RoadtoCode 10 ай бұрын
Hey@@itsgojoverfr ! I'm still on the self-taught learning path, I've come quite a long way from the 6 month old post and I thank you for the follow up! I have not applied for any jobs yet, I'm still not 100% confident I'm well rounded enough to bring value to an entry level role just yet. I am working on a full stack pet project, I found this to be the best way to learn although it certainly has taken its toll on me, mentally and time-wise. It's been great so far since I've now learned how to create a front end with React, backend with Node.js and calling API's from the db, in my case, MySql (with MySql Workbench). I took a 2 week break but am getting back to it today actually. My goal is to start applying for jobs in 2024, being that I am self-taught and work in an unrelated field, I'll need at least some full stack projects in my portfolio to substitute the lack of formal education and experience. I'd be interested to hear about your current journey?
@vibhukumar3806
@vibhukumar3806 2 жыл бұрын
The best REACT channel out there by quite a margin. Keep up the good work🔥
@CoderSineNomine
@CoderSineNomine Жыл бұрын
Here i am after almost 5 confusing videos, finally got it! subscribed and looking forward for more.. thanks Sonny!
@enfieldli9296
@enfieldli9296 2 жыл бұрын
State is the react way of definning variable, this is so refreshing!
@connorhodgson3873
@connorhodgson3873 2 жыл бұрын
Hey sonny. Just wanted to say how much I appreciate you sharing your knowledge with us. I am a beginner aspiring web developer, more interested in the front end but also know it is important to learn a lot of the back end too these days. All of this seems impossible to learn right now but I know if I stick it out it will be worthwhile in the end. Any advice you have would be appreciated! Thanks again
@eyoeltekle
@eyoeltekle 2 жыл бұрын
What a nice tutorial bro, I was struggling to understand this concept because most tutorials use complex examples this though was brilliant, tnxs
@bikramrumba3463
@bikramrumba3463 2 жыл бұрын
I truly appreciate you for being there. Keep rocking!!
@TinyMaths
@TinyMaths 11 ай бұрын
Just come across your channel (I think) and liking the way you explain things. After just over a year of leaning JavaScript and building many projects, I decided last week to take the plunge and begin learning React. Looks like I'll be frequenting your channel quite a bit.
@abhijeetmokale5604
@abhijeetmokale5604 2 жыл бұрын
Bro! Your way of explaining things is #awesome ! After all this time ,Now I feel confident in states!! Glad you started making this lesson videos.
@frogonajetski
@frogonajetski 2 жыл бұрын
This is THE best video explanation I have seen on this. Thank you so much. I totally understand now.
@inspisiavideos8542
@inspisiavideos8542 2 жыл бұрын
Sonny Shanga I had an internship as QA this Summer. They interviewed me again this past Wednesday and they will extend me the paid internship only this time it will be as React Engineer until the end of the year. The company protects Hospitals data (that’s all I’m saying). They liked the amazon and the airbnb clone I did from your channel. They told me they don’t have open positions for entry level but there might be some available later this year. Thanks man
@lalasmith2137
@lalasmith2137 2 жыл бұрын
Hey Sonny, new subscriber here- been binge watching all the challenges and trying for myself and the clones you built - just incredible and amazing that i found your channel. May i ask for some advanced projects as well? maybe with more focus on logic, form validations, server side requests just to learn the best practices from you! much love
@yaeldekanu9246
@yaeldekanu9246 Жыл бұрын
Great job! You do a great job explaining everything
@mohibkhan2492
@mohibkhan2492 2 жыл бұрын
Great video Sonny, please make a detailed video on useContext hook. Thanks
@jesper391
@jesper391 2 жыл бұрын
I agree
@DevlogBill
@DevlogBill Жыл бұрын
Wow I'm happy I began learning React after Hooks came out versus a class system, thank you for sharing.
@roshanguragain5578
@roshanguragain5578 2 жыл бұрын
I just found your channel and I can't control myself to say you are awesome. Anyway happy teachers day. Love you 💘
@berad6034
@berad6034 2 жыл бұрын
Best explanation on KZfaq. You're the man. Liked and subscribed
@privatesoul
@privatesoul 3 ай бұрын
Best video explanation I've ever seen. Your videos are legit, man.
@atharvavetal453
@atharvavetal453 2 жыл бұрын
This gus is so much hardworking he is even working on his holidays wow manh thats great ❤️
@atharvavetal453
@atharvavetal453 2 жыл бұрын
@@AtulKumar-jq7tw ik but he is focusing
@salarhashemian3436
@salarhashemian3436 2 жыл бұрын
Keep up the good work man this video was really help full
@BenOdari
@BenOdari 2 жыл бұрын
Sonny You be crowned the God of Reactjs I learn alot from This Channel...Lots of Love from Kenya
@emmanuelmanana1527
@emmanuelmanana1527 2 жыл бұрын
lessons from the master, brilliant
@passsacaglia
@passsacaglia 2 жыл бұрын
PAPAFAM here!
@crappycoders
@crappycoders Жыл бұрын
Yep thats what i needed before going to building the apps
@optimusworld
@optimusworld 5 ай бұрын
Thanks alot, your teaching was easy to understand.
@jimmyopot1972
@jimmyopot1972 2 жыл бұрын
Very informative, well understood useState hook.
@edwarda7096
@edwarda7096 2 жыл бұрын
Thanks Sonny! Would love a video or two using React-Spring in an app
@informatyx1
@informatyx1 2 жыл бұрын
You always provide valuable content ❤️❤️
@juhiojha2050
@juhiojha2050 2 жыл бұрын
your videos have so clearty..........your videos are amezing .......... :)
@srinivasaraoyp3640
@srinivasaraoyp3640 2 жыл бұрын
Very interesting video. Thank you.
@murtazaali5083
@murtazaali5083 2 жыл бұрын
Hi, Sonny great content. Highly recommend to make a react tutorial playlist. Cheers
@devislight
@devislight 2 жыл бұрын
Thank you so much 👨‍🏫🙋‍♂️
@luclekene8592
@luclekene8592 2 жыл бұрын
thank you so mush i love your work
@dx497
@dx497 2 жыл бұрын
I Love you Sonny superb tutorial 🚀🚀
@swayampravodasgupta2956
@swayampravodasgupta2956 2 жыл бұрын
Dropped in for my monthly show of gratitude
@farhanmaqsood9498
@farhanmaqsood9498 2 жыл бұрын
You are amazing papa react Can you please make full tutorial on react js
@nguyenbriton4263
@nguyenbriton4263 2 жыл бұрын
Great video, can you do a tutorial for Redux too?
@Bannords
@Bannords 2 жыл бұрын
Ты крутой, спасибо! I mean you are super rockstar)) thanks for guide)
@bsal5347
@bsal5347 2 жыл бұрын
Nobody can teach react better than the papa.
@nimasherpa8608
@nimasherpa8608 2 жыл бұрын
Your videos are awesome
@theetechverge7723
@theetechverge7723 2 жыл бұрын
So dope Mr #papareact!!! #papafamforever much love....
@ruebenhales8558
@ruebenhales8558 Жыл бұрын
Great content!
@Arabian_Epileptic
@Arabian_Epileptic 2 жыл бұрын
Nice sunny. I see that Dubai tan! 😁🎉
@georgeyvb4460
@georgeyvb4460 2 жыл бұрын
Hey a Trello clone would be cool, specially the drag n drop with auth and saving the data to a database with Nextjs
@shopsrise5137
@shopsrise5137 2 жыл бұрын
Thanku ❤ #PAPAfam New video from Dubai 😌🔥
@boujeeblackbabe2.0
@boujeeblackbabe2.0 2 жыл бұрын
Thanks!!
@xperwar
@xperwar 8 ай бұрын
love the content !!
@arjunjoshi3481
@arjunjoshi3481 2 жыл бұрын
Ayyy intro in Dubaiiii. Niceeeeee
@markj.voltaire5620
@markj.voltaire5620 2 жыл бұрын
great explanation
@M.W__
@M.W__ Жыл бұрын
thank you SO SO much
@juansebastianvalenciajimen2751
@juansebastianvalenciajimen2751 2 жыл бұрын
Sonny great intro that you have bro
@anaskhan4841
@anaskhan4841 2 жыл бұрын
Love you man
@mohibkhan2492
@mohibkhan2492 2 жыл бұрын
I remember this module was in skillshare 101 modules!
@mykesoftware3044
@mykesoftware3044 2 жыл бұрын
Long time bruh🤩React native project man.Bell is on
@zstudio6127
@zstudio6127 2 жыл бұрын
Boom Sony!!.. Love from BD
@Saur3n
@Saur3n 2 жыл бұрын
yoo sonny you are the best :)
@lawrencemotions8720
@lawrencemotions8720 2 жыл бұрын
love this is there any mongo db content coming .
@govindbchandran8681
@govindbchandran8681 2 жыл бұрын
Somehow didn't get the actual sonny sangha vibe. Maybe the music and the hype and stuff we get in livestreams. Great vid tho 😁
@martinkristofferssonn
@martinkristofferssonn Жыл бұрын
Great video! Please don't use vocals in your background music. It makes it sometimes hard to focus on what you are saying.
@mitotv6376
@mitotv6376 10 ай бұрын
Nice video
@tapanranipa
@tapanranipa 2 жыл бұрын
Hey dude please make a video on usereducer hook it is very complex in terms of how to use it and under which scenarios?? Please make a damn awesome video about it like you always make other ones 😂😂😂
@oxydoum
@oxydoum 2 жыл бұрын
Thanks bro, do you know how to do a waveform in a audio player with react?
@azad9655
@azad9655 2 жыл бұрын
Hey sonny, Make a video on Rest Api with React. Some of the APIs are very nested. not so easy to use. Would love to see how you manage the API
@juansebastianvalenciajimen2751
@juansebastianvalenciajimen2751 2 жыл бұрын
Remember guys that we can create our hooks called custom hooks, these custom hooks help us to share the logic for differents components
@pawanbhatt3847
@pawanbhatt3847 2 жыл бұрын
Nice sir
@JoonasKarp
@JoonasKarp 2 жыл бұрын
Could you possibly make tutorial on how to test react using Jest ?
@Faysal-Mridha
@Faysal-Mridha 2 жыл бұрын
We are PapaFam 🥳
@lexsemenenko7044
@lexsemenenko7044 2 жыл бұрын
What's a good way to update a nested property of an object in useState? My state stores an object with a property that holds an array. I need to update array items. The way I am doing it now is to clone the whole object, do the update, and then put the whole updated object back into useSate. Appreciate!
@martumbao2760
@martumbao2760 2 жыл бұрын
Hi, Sonny can you have a discount for the price for other country. Because the euro value for us is too expensive. And I just wanna thank you for your tutorials. It is very useful and easy to understand with your approach.
@thirdojohnson4325
@thirdojohnson4325 2 жыл бұрын
I really wished this guy taught python. Damn you are a good teacher
@swamini.pandit
@swamini.pandit 2 жыл бұрын
Module not found: Can't resolve 'firebase' in please solution
@Divyam2600
@Divyam2600 2 жыл бұрын
#papafam #papareact #sonnysanghe excitingly waiting for your new ui clone challenge as I have come up to this field recently in this month and started your amazon challenge which i am going to finish.. #amazonchallenge
@niravrk5446
@niravrk5446 2 жыл бұрын
Wait for next video
@cryptomallu6271
@cryptomallu6271 Жыл бұрын
best video
@godfataliti
@godfataliti 2 жыл бұрын
Agradecido con el de arriba 😊
@akhileshmishra5559
@akhileshmishra5559 2 жыл бұрын
Please sonny make one comment section with nested reply like and dislike system using usereducer and context please....👍👍
@drphil2424
@drphil2424 2 жыл бұрын
PAPA SONNY WE LOVE YOU
@TarunSingh24
@TarunSingh24 2 жыл бұрын
PLease make tutorial like this for - useEffect
@charuwaka1
@charuwaka1 2 жыл бұрын
please make tutorial on useEffect with same example
@karanjoshi12
@karanjoshi12 2 жыл бұрын
Please please please on complete dedicated video on redux (tips and tricks) to learn in (like you taught context API in Amazon clone)
@tauraikuvarega1580
@tauraikuvarega1580 2 жыл бұрын
can you do a class-based component tutorial
@familythestephens9739
@familythestephens9739 2 жыл бұрын
Make a desk setup video pls?!?!?!
@ekansh03
@ekansh03 2 жыл бұрын
Couldn't understand it better.
@timileyinquadri8668
@timileyinquadri8668 Жыл бұрын
Hello sonny, you mentioned something about making state persistent with a database, how does this work…or if anyone knows how kindly share, because I have a toggle button that makes a call to an endpoint and every time I refresh the page or go to another tab in the app it resets back to the default
@eriksark2102
@eriksark2102 2 жыл бұрын
Please do a react native snapchat clone! you're amazing
@deepaknegi4317
@deepaknegi4317 2 жыл бұрын
Hello, could you explain how to update multiple state variables depending on one another in functional Components like in-class components we can pass back a callBack to this.setState, we callback will update the state after it. in class component--> this.state ={count:0,ans:1} this.setState((prev)=>{return {...prev, count : count+1}},(prev)=>{return {...prev, ans: count * 2}}); in this way first "count" will be updated and then "ans" will be updated. How to achieve the same with functional components. in functional component--> const [count, setCount] = useState(0); const [ans, setAns] = useState(1); setCount(prev=>prev+1); setAns(prev=>count * 2); but as state updation is an async process then "setAns" could have old value of "count" i.e 0;
@mohammedsafwans1153
@mohammedsafwans1153 2 жыл бұрын
Newsletter fam, where you at???
@aryan7069_
@aryan7069_ 2 жыл бұрын
I saw you teaching clever programmer then came to your channel lol
@dipanjandas9463
@dipanjandas9463 2 жыл бұрын
Create a video about login form in React js.
@bernardmuchemi196
@bernardmuchemi196 Жыл бұрын
We've never seen your lefts side of the face Sonny😂😂
@crictube360
@crictube360 2 жыл бұрын
Owsmmm sir
@hasanahmed9917
@hasanahmed9917 2 жыл бұрын
do a tutorial on redux thunk or redux saga using the redux toolkit
@sardarjahan9064
@sardarjahan9064 2 жыл бұрын
Hi Sonny ,make some video on redux ,it will help us to grab some shit about react
@manasahr478
@manasahr478 Жыл бұрын
How to fetch data from api and how to create dropdown using fetched data.how to call function using selected option. Could you pls help me
@hasanahmed9917
@hasanahmed9917 2 жыл бұрын
please do a crm project
@mkilphewer2425
@mkilphewer2425 2 жыл бұрын
Iam a newbie The doubt i have is,in this video when u created a class based component and then import it in index.js..what u did is import app from (its location)...but the name of the component was not app right?..it was "appclass"..then how did it display it in the browser without any error..and even when u render the component in index.js..u simply wrote ..shouldn't it be ? Iam totally a beginner..need help
@jonroni5756
@jonroni5756 Жыл бұрын
Hello Sir! I have problem in useState: import React, {useState} from 'react' function App(){ var [data, dataUpdate]=useState(0); function change(){ dataUpdate(data+1); } return ( {data} change()}>Click Here ) } export default App Whenever i used useState it shows me the blank page after execution
@lukas.webdev
@lukas.webdev Жыл бұрын
Try changing it to: Click Here 😉
@fayasahamed5587
@fayasahamed5587 2 жыл бұрын
If you teach axois and formik for validation
Learn how to use Props in React in 19 minutes (for beginners)
19:12
Sonny Sangha
Рет қаралды 144 М.
Don't use Hooks in REACT without knowing this...
20:33
Sonny Sangha
Рет қаралды 56 М.
Купили айфон для собачки #shorts #iribaby
00:31
IS THIS REAL FOOD OR NOT?🤔 PIKACHU AND SONIC CONFUSE THE CAT! 😺🍫
00:41
⬅️🤔➡️
00:31
Celine Dept
Рет қаралды 35 МЛН
React useState() hook introduction 🎣
16:33
Bro Code
Рет қаралды 18 М.
React useEffect Hook
14:41
Piyush Garg
Рет қаралды 26 М.
Beginner React.js Coding Interview (ft. Clément Mihailescu)
36:31
Ben Awad
Рет қаралды 2,1 МЛН
React State Management - Intermediate JavaScript Course
2:46:38
freeCodeCamp.org
Рет қаралды 240 М.
Learn useState In 15 Minutes - React Hooks Explained
15:45
Web Dev Simplified
Рет қаралды 1,1 МЛН
Купили айфон для собачки #shorts #iribaby
00:31