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

Function useProductGuidesContext

components/context/ProductGuidesContext.tsx:31–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29export const ProductGuidesContext = createContext<ProductGuidesContextT | null>(null)
30
31export const useProductGuidesContext = (): ProductGuidesContextT => {
32 const context = useContext(ProductGuidesContext)
33
34 if (!context) {
35 throw new Error(
36 '"useProductGuidesContext" may only be used inside "ProductGuidesContext.Provider"'
37 )
38 }
39
40 return context
41}
42
43export const getProductGuidesContextFromRequest = (req: any): ProductGuidesContextT => {
44 const page = req.context.page

Callers 4

ArticleCardsFunction · 0.90
LearningTracksFunction · 0.90
ProductGuidesFunction · 0.90
GuidesHeroFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected