@prasiddha/react-window-size provides with a useWindowSize hook.
npm install @prasiddha/react-window-sizeterminal
npm install @prasiddha/react-window-size --save
`
Usage
`tsx
import { useWindowSize } from '@prasiddha/react-window-size';
const App = () => {
const { width, height } = useWindowSize();
return (
style={{
height: '100vh',
width: '100vw',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
}}
>
Height:{height}
Width:{width}