React

IntermediateLesson 5 of 1730 min, hands-on

Handling Events

Part of the React course

A component that only ever renders based on props and state is not interactive on its own, something has to notice when the user clicks a button, types into a field, or presses a key, and turn that into a state update. You already wired one onClick in the previous lesson without stopping to explain it.

This lesson's folder holds a small Vite project whose main.jsx shows the lesson's component in the browser. Install its packages and start the dev server ...

What you'll learn

  • onClick handler
  • onChange basics
  • Passing functions vs calling them
  • Event object
  • Passing handlers as props

Work through Handling Events

Sign in free and open the React course. Work through the lesson, and ask the AI tutor when you get stuck.