mirror of
https://github.com/streamich/react-use.git
synced 2025-12-08 18:02:14 +00:00
20 lines
306 B
Markdown
20 lines
306 B
Markdown
# `usePermission`
|
|
|
|
React side-effect hook to query permission status of browser APIs.
|
|
|
|
## Usage
|
|
|
|
```jsx
|
|
import {usePermission} from 'react-use';
|
|
|
|
const Demo = () => {
|
|
const state = usePermission({ name: 'microphone' });
|
|
|
|
return (
|
|
<pre>
|
|
{JSON.stringify(state, null, 2)}
|
|
</pre>
|
|
);
|
|
};
|
|
```
|