useState


This video is part of the following playlists:


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: https://github.com/Sam-Meech-Ward/react-state-jokes

🔗Final Code: https://github.com/Sam-Meech-Ward/react-state-jokes/tree/finalCode

This is video #6 in my react series:

Join this channel to support these videos and get access to perks: https://www.youtube.com/channel/UC6aTLuI_j4-0wiDSzmaPctQ/join

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

Find an issue with this page? Fix it on GitHub