MCPcopy Create free account
hub / github.com/StaticMania/keep-react / useAlertContext

Function useAlertContext

app/src/components/Alert/AlertContext.tsx:11–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9export const AlertContext = createContext<AlertContextProps | undefined>(undefined)
10
11export function useAlertContext(): AlertContextProps {
12 const context = useContext(AlertContext)
13
14 if (!context) {
15 throw new Error('useAlertContext should be used within the AlertContext provider!')
16 }
17
18 return context
19}

Callers 5

Icon.tsxFile · 0.90
Dismiss.tsxFile · 0.90
Link.tsxFile · 0.90
Description.tsxFile · 0.90
Title.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected