useWindowSize()
The useWindowSize()
hook provides the current window width
and height
dimensions.
Import
import { useWindowSize } from 'react-haiku';
Usage
Loading...
import { useWindowSize } from 'react-haiku';
export const Component = () => {
const { height, width } = useWindowSize();
return (
<div>
<b>Resize Your Window!</b>
<p>Window Height: <span>{height}</span></p>
<p>Window Width: <span>{width}</span></p>
</div>
);
};