UseCanAccessAdminPanelResult
Defined in: packages/react/src/access/useCanAccessAdminPanel.ts:20
Result of useCanAccessAdminPanel — a tri-state, not a plain
boolean, because a public-page caller (no VexAuthProvider, resolving the
caller from a reactive client session instead) genuinely doesn’t know the
answer for one tick after mount. A header that renders nothing while
isPending is true and an “Admin” link the instant it flips false
pops the link in after a signed-in visitor already sees the rest of the
header — reserve the link’s own fixed-size slot (e.g. an invisible
placeholder matching its box) for the isPending window instead, the same
“always occupy the slot” treatment SessionButton uses for sign-in/out.
Properties
Section titled “Properties”canAccess
Section titled “canAccess”canAccess:
boolean
Defined in: packages/react/src/access/useCanAccessAdminPanel.ts:25
Whether the current caller passes the adminPanel.access check. Only
meaningful once isPending is false — always false while pending.
isPending
Section titled “isPending”isPending:
boolean
Defined in: packages/react/src/access/useCanAccessAdminPanel.ts:31
Whether the caller is still being resolved. false inside /admin
(the caller is server-resolved, synchronous) — only ever true on a
public page, for the one tick before the client session settles.