react-use/docs/usePermission.md
2019-06-27 00:57:38 +08:00

325 B

usePermission

React UI hook that query permission status from the user depends on the specific AP.

Usage

import {usePermission} from 'react-use';

const Demo = () => {
  const state = usePermission({ name: 'microphone' });

  return (
    <pre>
      {JSON.stringify(state, null, 2)}
    </pre>
  );
};