react-use/docs/usePermission.md
2019-07-02 13:08:53 +08:00

335 B

usePermission

React side-effect hook that query permission status from the user depends on the specific API.

Usage

import {usePermission} from 'react-use';

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

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