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
16 lines (13 loc) • 393 B
text/typescript
import {useContext} from 'react'
import {MentionUserContext} from 'sanity/_singletons'
import {type MentionUserContextValue} from './types'
/**
* @internal
*/
export function useMentionUser(): MentionUserContextValue {
const context = useContext(MentionUserContext)
if (!context) {
throw new Error('useMentionUser must be used within a MentionUserProvider')
}
return context
}