UNPKG

sanity

Version:

Sanity is a real-time content infrastructure with a scalable, hosted backend featuring a Graph Oriented Query Language (GROQ), asset pipelines and fast edge caches

20 lines (15 loc) 375 B
import {useContext} from 'react' import {PaneContext} from './PaneContext' import {type PaneContextValue} from './types' /** * * @hidden * @beta This API will change. DO NOT USE IN PRODUCTION. */ export function usePane(): PaneContextValue { const pane = useContext(PaneContext) if (!pane) { throw new Error('Pane: missing context value') } return pane }