createTypeSafeContext.ts
/**
* Provides a way to create typesafe contexts without having to check for null
* initial values all of the time.
* @see https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/context/
*/
export default function createTypeSafeContext<A extends unknown | null>(): readonly [
() => A & (unknown | null),
React.Context<A | undefined>