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

1.0.0 • Public • Published

@reactutils/use-windows-size

NPM NPM

this hook returns an object containing the window's width and height. If executed server-side (no window object) the value of width and height will be undefined.

Installation

npm install @reactutils/use-windows-size

# or

yarn add @reactutils/use-windows-size

Usage

import useWindowSize from '@reactutils/use-windows-size';

// Usage
function App() {
  const size = useWindowSize();
  
  return (
    <div>
      {size.width}px / {size.height}px
    </div>
  );
}

Package Sidebar

Install

npm i @reactutils/use-windows-size

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

3.02 kB

Total Files

7

Last publish

Collaborators

  • sepehr09