usePermission ​
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
Name | Type | Default | Note |
---|---|---|---|
permissionDescriptorName | UsePermissionName | - | - The permission name |
options.enabled? | boolean | true | - Whether the permission is enabled |