Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 306 Bytes

usePermission.md

File metadata and controls

19 lines (14 loc) · 306 Bytes

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>
  );
};