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
24 lines (21 loc) • 499 B
text/typescript
import {useContext} from 'react'
import {TreeEditingEnabledContext} from 'sanity/_singletons'
/**
* @internal
*/
export interface TreeEditingEnabledContextValue {
/**
* A boolean indicating whether tree editing is enabled
*/
enabled: boolean
/**
* A boolean indicating whether legacy editing is enabled
*/
legacyEditing: boolean
}
/**
* @internal
*/
export function useTreeEditingEnabled(): TreeEditingEnabledContextValue {
return useContext(TreeEditingEnabledContext)
}