use-viewport-size
Returns viewport width and height and subscribes to changes
Source
Docs
PackageIcon
Usage
The use-viewport-size hook returns the current viewport's width and height. It subscribes to resize and orientationchange events.
During SSR, the hook will return { width: 0, height: 0 }:
Width: 0, height: 0