CautionFrequent resizing can trigger many re-renders. If you only need to react to specific breakpoints, consider using useIsDesktop or a matchMedia based hook instead for better performance.
A reactive hook that tracks the window.innerWidth and window.innerHeight. It attaches a single resize listener on mount and cleans it up on unmount, providing a real-time object of the viewport dimensions.
| Name | Type | Description |
|---|---|---|
| height | number | The current window.innerHeight. |
| width | number | The current window.innerWidth. |
0 x 0