react-use-window-sizes
v1.0.3
Published
A lightweight package to easily track window size in React.js
Downloads
19
Maintainers
Readme
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)
}