mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 09:15:58 +02:00
13 lines
329 B
TypeScript
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
|
|
}
|