Provides methods for writing/reading values in application context in a type-safe way. Primarily for usage with middleware.
import {
unstable_createContext,
unstable_RouterContextProvider
} from "react-router";
const userContext = unstable_createContext<User | null>(null);
const contextProvider = new unstable_RouterContextProvider();
contextProvider.set(userContext, getUser());
// ^ Type-safe
const user = contextProvider.get(userContext);
// ^ User