Skip to content

useDevicePixelRatio ​

Category
Utilities

Hook that returns the ratio of the resolution in physical pixels to the resolution in CSS pixels for the current display device

typescript
import { useDevicePixelRatio } from '@siberiacancode/reactuse';

Usage ​

typescript
const { supported, ratio } = useDevicePixelRatio();

Demo ​

Api ​

Contributors ​

Source • Demo