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