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) • 408 B
text/typescript
import {useContext} from 'react'
import {ReviewChangesContext} from './ReviewChangesContext'
import {type ReviewChangesContextValue} from './types'
/**
* @internal
*/
export function useReviewChanges(): ReviewChangesContextValue {
const reviewChanges = useContext(ReviewChangesContext)
if (!reviewChanges) {
throw new Error('Review changes: missing context value')
}
return reviewChanges
}