FezVrasta/popper.js

View on GitHub
packages/react-dom/src/utils/getDPR.ts

Summary

Maintainability
A
1 hr
Test Coverage
export function getDPR(element: Element): number {
  if (typeof window === 'undefined') {
    return 1;
  }
  const win = element.ownerDocument.defaultView || window;
  return win.devicePixelRatio || 1;
}