September 2022
Intermediate to advanced
410 pages
10h 7m
English
At this point, React has taken over part of our page and is drawing the seats (although if you’ve looked at the before and after, you’ll see that it was color-coding used tickets and it’s not anymore, we’ll bring that back in Chapter 11, Managing State in React). This is nice enough, but we’d like it to, you know, react to something. We’d like to have a little interactivity.
In React, you can use JSX to specify event handlers on React elements in much the same way you would when writing old-school JavaScript embedded in HTML. The problem is how to make changes to our components as a result of those events. As mentioned, the props we pass into each component are immutable, which means if we want to change something ...