useAdminContext
const useAdminContext = (): types.IReadAdminContextHook with no arguments to access some useful values from the AdminContext. It returns an object.
Example usage
Section titled “Example usage”const { isAdmin, previewMode } = useAdminContext()AdminContext
Section titled “AdminContext”The AdminContext provides the context needed by the admin editing interface.
The useAdminContext returned object has the following interface
interface IReadAdminContext { isAdmin: boolean previewMode: boolean}isAdministruein the Admin interface andfalseon the public front-end.previewModeistruewhen the Full-screen preview is active in the Admin interface andfalseotherwise.
The <Admin> component wraps all the children with the AdminContext Provider.