Open TMarciDev opened 1 month ago
If I use it on a page where the responsive design alters the zoom value on the body to like 75% to make everything fit, the useMeasure will not correct for that and returns smaller values than the actual size.
To correct width and height you can do this:
const [ref, measurement] = useMeasure(input); const result = { ...measurement, height: getCorrectedSize(measurement.height), width: getCorrectedSize(measurement.width) };
and this will gives back the correct sizes.
If I use it on a page where the responsive design alters the zoom value on the body to like 75% to make everything fit, the useMeasure will not correct for that and returns smaller values than the actual size.
To correct width and height you can do this:
and this will gives back the correct sizes.