https://codepen.io/ferdotnet/pen/gOKKRJE
yarn add @ferdotnet/use-window-size
import React from 'react';
import useWindowSize from '@ferdotnet/use-window-size';
export default () => {
const { width, height } = useWindowSize();
return <div>width: {width} height: {height}</div>;
};