1.2.0 • Published 11 months ago

use-screen-dimensions v1.2.0

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

Hook use-screen-dimensions

Custom react hook to get current window/screen dimensions

Installation

  • npm:
npm install use-screen-dimensions
  • yarn:
yarn add use-screen-dimensions

How to use

import React from "react";

import {useScreenDimensions} from "use-screen-dimensions";

const Component: React.FC = () => {
  const { width, height } = useScreenDimensions();

  console.log("width: " + width + "height: " + height);

  return (
    <div>
      <h1>
        Height: {width} | Width: {height}
      </h1>
    </div>
  );
};
1.2.0

11 months ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago