https://github.com/halo-lab/use-resizing
React Hook that triggers on window resize
https://github.com/halo-lab/use-resizing
hooks react reactjs resize
Last synced: about 1 year ago
JSON representation
React Hook that triggers on window resize
- Host: GitHub
- URL: https://github.com/halo-lab/use-resizing
- Owner: Halo-Lab
- Created: 2020-04-02T09:43:10.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T09:52:17.000Z (over 3 years ago)
- Last Synced: 2025-04-09T22:06:46.495Z (about 1 year ago)
- Topics: hooks, react, reactjs, resize
- Language: JavaScript
- Homepage:
- Size: 453 KB
- Stars: 16
- Watchers: 5
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
useResizing
React Hook that triggers on window resize
Example
In your React component:
```
import useResize from "use-resizing"
function SizeInfo() {
const screenSize = useResize()
return
size = ({ screenSize.width }, { screenSize.height })
}
```
Settings:
debounceTime - number (default 100ms)
```
...
const screenSize = useResize({debounceTime:200})
```
## Word from author
Have fun! ✌️