useWindowSize ​
Hook that manages a window size
typescript
import { useWindowSize } from '@siberiacancode/reactuse';
Usage ​
typescript
const { width, height } = useWindowSize();
Demo ​
Api ​
Parameters
Name | Type | Default | Note |
---|---|---|---|
params.initialWidth? | number | Number.POSITIVE_INFINITY | The initial window width |
params.initialHeight? | number | Number.POSITIVE_INFINITY | The initial window height |