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
18 lines (12 loc) • 469 B
text/typescript
import {useContext} from 'react'
import {PresentationNavigateContext} from 'sanity/_singletons'
import {type PresentationNavigateContextValue} from './types'
/** @public */
export function usePresentationNavigate(): PresentationNavigateContextValue {
const navigate = useContext(PresentationNavigateContext)
if (!navigate) {
throw new Error('Presentation navigate context is missing')
}
return navigate
}
export type {PresentationNavigateContextValue}