1.0.3 • Published 3 years ago

react-device-hooks v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-device-hooks

NPM JavaScript Style Guide

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.