MCPcopy Create free account
hub / github.com/github/docs / useTocLandingContext

Function useTocLandingContext

components/context/TocLandingContext.tsx:25–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23export const TocLandingContext = createContext<TocLandingContextT | null>(null)
24
25export const useTocLandingContext = (): TocLandingContextT => {
26 const context = useContext(TocLandingContext)
27
28 if (!context) {
29 throw new Error('"useTocLandingContext" may only be used inside "TocLandingContext.Provider"')
30 }
31
32 return context
33}
34
35export const getTocLandingContextFromRequest = (req: any): TocLandingContextT => {
36 return {

Callers 1

TocLandingFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected