1.0.3 • Published 3 years ago

react-use-window-sizes v1.0.3

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

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) 

}