This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@wbe/use-window-size
TypeScript icon, indicating that this package has built-in type declarations

2.7.1 • Public • Published

@wbe/use-window-size

This React hook allow to get dynamically window dimensions.

Installation

$ npm install -s @wbe/use-window-size

How to use

import { useWindowSize } from "@wbe/use-window-size";

const App = () => {
  // get window size
  const { width, height } = useWindowSize();

  // Resize your browser and check width & height change.
  return (
    <ul>
      <li>window width: {width}</li>
      <li>window height: {height}</li>
    </ul>
  );
};

Returned

The hook return object who contains window dimensions:

{
  "width": number,
  "height": number
}

Readme

Keywords

Package Sidebar

Install

npm i @wbe/use-window-size

Weekly Downloads

2

Version

2.7.1

License

MIT

Unpacked Size

27 kB

Total Files

18

Last publish

Collaborators

  • willybe