Skip to content

usePermission ​

Category
Browser

Hook that gives you the state of permission

typescript
import { usePermission } from '@siberiacancode/reactuse';

Usage ​

typescript
const { state, supported, query } = usePermission('microphone');

Demo ​

Api ​

Parameters

NameTypeDefaultNote
permissionDescriptorNameUsePermissionName-- The permission name
options.enabled?booleantrue- Whether the permission is enabled

Contributors ​

Source • Demo