React Hooks: useState

preview_player
Показать описание
Learn how to use useState in a react app to:

* Keep track of state for a single component
* Update state with values and updater functions
* Share state between multiple components
* Keep track of state for form inputs and share that with a parent component

🔗Starter Code:

🔗Final Code:

This is video #6 in my react series:

Join this channel to support these videos and get access to perks:

Chapters:
0:00​ Intro
0:59 The Wrong Way
2:59 Introducing useState
4:01 useState Explained
6:50 useState is async
8:35 Setter Functions
9:34 Updated Variable
10:04 Multiple State Variables
12:18 Sharing State between Components
16:03 State and Forms
20:25 Summary

🔗Moar Links
Рекомендации по теме
Комментарии
Автор

You explained how to use useState really well and provided a great example. I especially liked how you broke down how to lift state up and share it between components. Thank you!

alexzahrai
Автор

Simply WoW! Great demo of async operation and use of useState. You make the underlying concepts so much clearer. Thank you Sam..

sethurk
Автор

Great video. You make more complicated concepts easy to digest. Question though, why not use "getter" and "setter" language when talking about useState variables?

aprilm
Автор

I truley enjoyed. Adding Favorite button was exciting part🤩

siavoshoon
Автор

good series. thanks. dropping a comment for the yt algorithm :)))

nickyggoodman