mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 17:25:59 +02:00
13 lines
318 B
TypeScript
13 lines
318 B
TypeScript
import { useContext } from "react"
|
|
import { SidebarContext, SidebarContextInterface } from "../SidebarProvider"
|
|
|
|
export default function useSidebar(): SidebarContextInterface {
|
|
const sidebarContext = useContext(SidebarContext)
|
|
|
|
if (!sidebarContext) {
|
|
throw Error("Need context")
|
|
}
|
|
|
|
return sidebarContext
|
|
}
|