This package provides you with an easy-to-use custom react hook called useClientDimensions()
that will provide you with the client width and height. These dimensions are responsive to resizing of the client window.
React client dimensions is a very easy-to-use and concise library. The package's import cost is 168 B (with all dependencies, minified and gzipped).
All you need to do is,
- Import the package
import { useClientDimensions } from "react-client-dimensions";
- Use it
const { vw, vh } = useClientDimensions();
Yeah, it's that simple.