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
15 lines (10 loc) • 405 B
text/typescript
import {useContext} from 'react'
import {CommentsOnboardingContext} from 'sanity/_singletons'
import {type CommentsOnboardingContextValue} from '../context/onboarding/types'
export function useCommentsOnboarding(): CommentsOnboardingContextValue {
const ctx = useContext(CommentsOnboardingContext)
if (!ctx) {
throw new Error('useCommentsOnboarding: missing context value')
}
return ctx
}