Class

useCurrentAdmin

useCurrentAdmin

Hook which allows you to get and set currentAdmin

Usage

import { useCurrentAdmin } from 'adminjs'

const myComponent = () => {
  const [currentAdmin, setCurrentAdmin] = useCurrentAdmin()
  // ...
}

Type Definitions

Array

# UseCurrentAdminResponse

Result of the useCurrentAdmin.

It is a tuple containing value and the setter

Properties:
Name Type Attributes Description
0 CurrentAdmin | null <optional>

current admin

1 React.Dispatch.<React.SetStateAction.<CurrentAdmin>> <optional>

value setter compatible with react useState

View Source adminjs/src/frontend/hooks/use-current-admin.ts, line 34