Frontend with React
🖱️ Events and forms
Responding to user interaction: event handlers, controlled inputs, and forms with onSubmit.
What you'll learn
- Handle events by passing functions to props like
onClickandonChange, and read the event object - Create controlled inputs by binding their
valueto state and updating it ononChange - Manage forms with
onSubmitand cancel the reload withe.preventDefault() - Apply state as the single source of truth to validate or transform what the user types
Lessons
Handling eventsResponding to clicks and other user actions. Controlled inputsThe input's value lives in the state. FormsSubmitting data with onSubmit and multiple fields.Practice this module in the app
DevPath is a hands-on course: you read the theory here; in the app you put it into practice with exercises that really run, offline.
Start free in the app →