Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 20x 20x 635x 635x 635x 635x | import { Context, useContext } from "react"; import { ContextError } from "utils"; export function useCustomContext<T>( Context: Context<T | undefined> ): NonNullable<T> { const context = useContext(Context); Iif (!context) { throw new ContextError(Context); } return context; } |