use-resizing

2.1.7 • Public • Published

useResizing

useResizing demo

React Hook that triggers on window resize

Example
In your React component:

import useResize from "use-resizing"

function SizeInfo() {
  const screenSize = useResize()

  return <div>size = ({ screenSize.width }, { screenSize.height })</div>
}

Settings:
debounceTime - number (default 100ms)

...
const screenSize = useResize({debounceTime:200})

Readme

Keywords

Package Sidebar

Install

npm i use-resizing

Weekly Downloads

4

Version

2.1.7

License

ISC

Unpacked Size

3.26 kB

Total Files

3

Last publish

Collaborators

  • prostory
  • halolab
  • tyagun.aleksandr