variable userContext
Since 0.2.0

Key holding the authenticated principal, or null on an anonymous request.

The null default means context.get(userContext) resolves to null rather than throwing when no principal is attached — React Router's get() throws No value found for context for an unset key that has no default.

Type

RouterContextKey<IPrincipal | null>

Usage

import { userContext } from "react-router-plugin/src/index.ts";