react-use-window-sizes

1.0.3 • Public • Published

useWindowSizes - a custom React hook

A lightweight package to easily track window width & height in React.js

Comes in handy for responsize design and animations

Install

npm install react-use-window-sizes

Example

import React from 'react'
import { useWindowSizes } from 'react-use-window-sizes'

function MyApp() {
  const { width, height } = useWindowSizes();
  console.log('width:', width, 'height:', height) 

}

Package Sidebar

Install

npm i react-use-window-sizes

Weekly Downloads

5

Version

1.0.3

License

MIT

Unpacked Size

3.64 kB

Total Files

5

Last publish

Collaborators

  • hxf31891