|
Download react-use/docs/useOrientation.md from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 381 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-use/docs/useOrientation.md
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-use/docs/useOrientation.md
-
curl -L -o useOrientation.md https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-use/docs/useOrientation.md
381 Bytes
useOrientation
React sensor hook that tracks screen orientation of user's device.
Returns state in the following shape
{
angle: 0,
type: 'landscape-primary'
}
Usage
import {useOrientation} from 'react-use';
const Demo = () => {
const state = useOrientation();
return (
<pre>
{JSON.stringify(state, null, 2)}
</pre>
);
};