|
Download react-use/docs/usePermission.md from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 306 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-use/docs/usePermission.md
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-use/docs/usePermission.md
-
curl -L -o usePermission.md https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-use/docs/usePermission.md
306 Bytes
| # `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> | |
| ); | |
| }; | |
| ``` | |