Files
website/src/hooks/useLocation.tsx
T

13 lines
329 B
TypeScript

import { useContext } from "react"
import { ILocationContextInterface, LocationContext } from "../LocationProvider"
export default function useLocation(): ILocationContextInterface {
const locationContext = useContext(LocationContext)
if (!locationContext) {
throw Error("Need context")
}
return locationContext
}