Event Handling in the React Way
The focus of this chapter is event handling. React has a unique approach to handling events: declaring event handlers in JSX. We’ll get things started by looking at how event handlers for particular elements are declared in JSX. Then, we’ll explore inline and higher-order event handler functions.
Afterward, you’ll learn how React maps event handlers to DOM elements under the hood. Finally, you’ll learn about the synthetic events that React passes to event handler functions and how they’re pooled for performance purposes. Once you’ve completed this chapter, you’ll be comfortable implementing event handlers in your React components. At that point, your applications come to life for your users because they are then able to interact with them.
The following topics are covered in this chapter:
- Declaring event handlers
- Declaring inline event handlers
- Binding handlers to elements...