Skip to content

Halo-Lab/use-resizing

Repository files navigation

useResizing

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})

Word from author

Have fun! ✌️

Supported by Halo lab

Releases

No releases published

Packages

No packages published