O'Reilly logo

Developing a React Edge: The JavaScript Library for User Interfaces by The League of Extraordinary Developers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Event Handling

When it comes to user interfaces, presenting is only half the equation. The other part is responding to user input, which in JavaScript means handling user-generated events.

React’s approach to event handling is to attach event handlers to components, and then to update those components’ internal states when the handlers fire. Updating the component’s internal state causes it to re-render, so all that is required for the user interface to reflect the consequences of the event is to read from the internal state in the component’s render function.

Although it is common to update state based solely on the type of the event in question, it is often necessary to use additional information from the event in order to determine ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required