Using the Context

Refactor the React code to use context in this lesson.

Venue component

Without having to pass properties or handle data, the Venue component gets a lot simpler:

Press + to interact
import * as React from "react"
import Subtotal from "./subtotal"
import VenueBody from "./venue_body"
import VenueHeader from "./venue_header"
export const Venue = () => {
return (
<>
<Subtotal />
<VenueHeader />
<VenueBody />
</>
)
}
export default Venue

It’s just calling three other components: the VenueHeader and VenueBody we already had, and our new one, Subtotal.

VenueHeader component

I’d like to ...