A React Hooks package for window-size
npm install @rooks/use-window-size```
npm install rooks
or
``
yarn add rooks
Rooks is completely treeshakeable and if you use only 1 of the 50+ hooks in the package, only that hook will be bundled with your code. Your bundle will only contain the hooks that you need. Cheers!
!Build Status   
``
npm install --save @rooks/use-window-sizeImporting the hook
`javascript`
import useWindowSize from "@rooks/use-window-size"
`jsx
function WindowComponent() {
const { innerWidth, innerHeight, outerHeight, outerWidth } = useWindowSize();
return (
innerHeight -
{innerHeight}
innerWidth -
{innerWidth}
outerHeight -
{outerHeight}
outerWidth -
{outerWidth}
| Returned object attributes | Type | Description |
| -------------------------- | ---- | ---------------------- |
| width | int | inner width of window |
| height | int | inner height of window |
| outerWidth | int | outer height of window |
| outerHeight | int | outer width of window |