Skip to content
WebDev Path
Back

Week 11: State, events and forms

Next video

Free lesson by Web Dev Simplified on YouTube

About this lesson

Module:
React
Time:
about 11 hours
Video:
16 min

Make components interactive and keep data in the right place.

By the end of this week you can

  • Use useState for local state
  • Handle events and controlled inputs
  • Lift state up to share it

Learn

  • useState
  • Event handlers
  • Controlled forms
  • Lifting state up

Read or watch

Practice

  1. Shopping cart with add, remove and totals
  2. A form with validation messages

Build

Add a cart to your product list.

Check your understanding

Score 4 out of 5 to complete this week.

  1. 1. What happens when you call a state setter from useState?
  2. 2. Which update is safest when the new value depends on the old one?
  3. 3. How should you update an object in state?
  4. 4. What is a controlled input?
  5. 5. Two sibling components need the same state. Where should it live?
0 of 5 answered