Skip to content

Function: HasRole() ​

ts
function HasRole(props): Element | null;

Defined in: packages/react/src/components.tsx:67

Renders children if the user has the role(s) — like spatie's @role / @hasanyrole / @hasallroles.

Parameters ​

ParameterType
propsHasRoleProps

Returns ​

Element | null

Released under the MIT License. Inspired by spatie/laravel-permission.