useAdminContext
const useAdminContext = (): types.IReadAdminContextHook with no arguments to access some useful values from the AdminContext. It returns an object.
Example usage
const { isAdmin, previewMode } = useAdminContext()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 dashboard andfalseon the public front-end.previewModeistruewhen the Full-screen preview is active in the Admin dashboard andfalseotherwise.
The <Admin> component wraps all the children with the AdminContext Provider.