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 (13 loc) • 421 B
text/typescript
import {useContext} from 'react'
import {CommentsSelectedPathContext} from 'sanity/_singletons'
import {type CommentsSelectedPathContextValue} from '../context'
/**
* @internal
*/
export function useCommentsSelectedPath(): CommentsSelectedPathContextValue {
const ctx = useContext(CommentsSelectedPathContext)
if (!ctx) {
throw new Error('useCommentsSelectedPath: missing context value')
}
return ctx
}