React State not Updating Immediately [Solved] | setState | React Hooks 💥

preview_player
Показать описание
In this video we are going to see:
How we can use immediately updated state value in react.

#reactjs #reacthooks #setState #code #react #webdevelopement #developer
Рекомендации по теме
Комментарии
Автор

Thanks man, this was just what the doctor ordered. You didn't help me solve just one problem, you helped me fix many problems that I've had and probably will have in the future. I'm really beginning to understand just how powerful the hooks are in React.

vernevens
Автор

Ngl I didn't have a lot of confidence that this would help going in, but it actually solved my problem. Thank you!

MrPicklepod
Автор

Really appreciate you taking time out to demo this, been struggling with this very thing all morning, was driving me mad!
Thanks

Morgulant
Автор

Oh my gosh I’ve been having a stupid issue getting my input to update state (something I’ve done before several times) and just couldn’t remember or figure out what I was doing wrong. Looking at your code helped me figure it out when even stacksoverflow could not. Merci beaucoup!! 🙏

vitaharvey
Автор

If you do like this, open network tab and see, infinite numbers of api request will be sent to server, state changes simultaneously

sandyGamer
Автор

hats off solved my 2 day problem keep making videos

sohammanjare
Автор

I just couldn't get my code to work under any conditions. What ended up working for me was putting the setItem() in the right area. I was also having trouble because I would try to use a const array to store information and then set the setArray to my const array. Which worked on another thing but wasn't working out this time so I just got rid of it and stored my information directly to the useState array using setArray and got rid of the const array. Well I kept the const array for console logging but I stopped entangling it with my useState.

jackmiddleton
Автор

This is a really nice explanation - thanks

dboland
Автор

Simple and nice. I watched it in mute.

pavanshirguppi
Автор

wow thank you so much brother, finally i can do login after hours :(((

johanesalberto
Автор

Thank you. This really helped me solve my issue

happinessbalogun
Автор

This is basic React 101. Use an AI tool for stuff like this. Then, you can avoid the bad music and noob teaching. gemini> Show me a simple login form with you state and use effect for setting username and password using controlled inputs. complete with handlers.

francistrujillo
Автор

I don't believe this is a good practice.

shahemhaddad