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
19 lines (14 loc) • 440 B
text/typescript
import {useContext} from 'react'
import {CommentsAuthoringPathContext} from 'sanity/_singletons'
import {type CommentsAuthoringPathContextValue} from '../context'
/**
* @beta
* @hidden
*/
export function useCommentsAuthoringPath(): CommentsAuthoringPathContextValue {
const value = useContext(CommentsAuthoringPathContext)
if (!value) {
throw new Error('useCommentsAuthoringPath: missing context value')
}
return value
}