Bluesky app fork with some witchin' additions 💫 forked from jollywhoppers.com/witchsky.app
Something went wrong. Try again.
666 B · 27 lines
TSX
at commit 8ce9bdb2
12345678910111213141516171819202122232425262728import React from 'react'
import {type ContextType, type ItemContextType} from '#/components/Menu/types'
export const Context = React.createContext<ContextType | null>(null)
export const ItemContext = React.createContext<ItemContextType | null>(null)
export function useMenuContext() { const context = React.useContext(Context)
if (!context) { throw new Error('useMenuContext must be used within a Context.Provider') }
return context}
export function useMenuItemContext() { const context = React.useContext(ItemContext)
if (!context) { throw new Error('useMenuItemContext must be used within a Context.Provider') }
return context}