custom react hook to get current window dimensions
npm install use-screen-dimensionsCustom react hook to get current window/screen dimensions
- npm:
``shell`
npm install use-screen-dimensions
- yarn:
`shell`
yarn add use-screen-dimensions
`ts
import React from "react";
import {useScreenDimensions} from "use-screen-dimensions";
const Component: React.FC = () => {
const { width, height } = useScreenDimensions();
console.log("width: " + width + "height: " + height);
return (