Sharing State - Row & Seat Components

Read about how to share state in the row component this lesson.

The rows in the venue body are the same as before, except we are passing the number of tickets to buy as a new prop in the object.

The Row component has gotten a lot more functionality, some of which has been taken from the Seat component. In this version of the code, the status of a seat depends on the status of the seats next to it—if the tickets to buy number is two, then a set with an already sold seat next to it is not available. Because an individual seat can no longer contain all the data needed to ascertain it’s status, the status for the entire row now needs to be stored in the Row component.

Here’s the Row code:

Get hands-on with 1400+ tech skills courses.