react-device-hooks
v1.0.3
Published
>
Downloads
16
Maintainers
Readme
react-device-hooks
Install
npm install --save react-device-hooks
Usage
import * as React from "react";
import { useScreen } from "react-device-hooks";
const Example = () => {
const { width, height, orientation } = useScreen();
return (
<div>
<p>Device width = {width}</p>
<p>Device height = {height}</p>
<p>Device orientation = {orientation}</p>
</div>
);
};
The useScreen
hook return a object, which contains the height, width and orientation angle of the client screen.
License
MIT © subhashishnabajja
This hook is created using create-react-hook.