Chapter 3. User Events
Ottergram now displays otters’ images and names, and that is great. However, users expect more from a modern application. Users want to be able to interact with your website. For example, it would be nice if users could click one of the post items to showcase a special otter.
In this chapter, you will implement this functionality using an event handler. Event handlers let React know what to do when a user event, such as a button click, occurs. Handling events in React is similar to handling events in standard HTML and JavaScript – with a few differences, which we will discuss along the way.
By the end of this chapter, you will be able to select different posts and see in the Console tab that you have clicked them. And ...
Get React Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.