createContext creates a context object for sharing a value with descendant components. Keep the context in its own file so the provider and consumers can import the same object. section 8.1.4
Sharing the current user
A bookings app can create UserContext, then place user state in its Provider. Components such as BookingDetails read that value with useContext instead of receiving the user through every intermediate component. The provider can wrap the whole application or only the routes that need the value. section 8.1.4
Listing 8.3 Creating and exporting a context object for our user value
import {createContext} from "react";
const UserContext = createContext();
export default UserContext;
The minimal creation step imports createContext, creates UserContext, and exports it for providers and consumers. section 8.1.4

