Using Props With Context
Explore how to use props alongside React context to manage global state efficiently. This lesson teaches you to simplify components by delegating state management to context and dispatch actions with reducers, improving application interactivity and maintainability.
We'll cover the following...
We'll cover the following...
The Row component is no longer tracking the state of its seats, so it can be much simpler:
Note that we haven’t abandoned the use of props. The row number of each row isn’t a part of the global state, so we pass it to that row as a prop. Similarly, each Seat component will receive its row and seat number as props.