|
| 1 | +diff --git a/lib/commonjs/hooks/useBoundingClientRect.js b/lib/commonjs/hooks/useBoundingClientRect.js |
| 2 | +index b4a90b76ee55bf2cad9cf461017621b1ddab0fe1..ccd592713dbbdf47957d24a5bced0ea4742a82ad 100644 |
| 3 | +--- a/lib/commonjs/hooks/useBoundingClientRect.js |
| 4 | ++++ b/lib/commonjs/hooks/useBoundingClientRect.js |
| 5 | +@@ -46,7 +46,7 @@ function useBoundingClientRect(ref, handler) { |
| 6 | + } |
| 7 | + |
| 8 | + // @ts-ignore 👉 https://github.com/facebook/react/commit/53b1f69ba |
| 9 | +- if (ref.current.unstable_getBoundingClientRect !== null) { |
| 10 | ++ if (ref.current.unstable_getBoundingClientRect) { |
| 11 | + // @ts-ignore https://github.com/facebook/react/commit/53b1f69ba |
| 12 | + const layout = ref.current.unstable_getBoundingClientRect(); |
| 13 | + handler(layout); |
| 14 | +@@ -54,7 +54,7 @@ function useBoundingClientRect(ref, handler) { |
| 15 | + } |
| 16 | + |
| 17 | + // @ts-ignore once it `unstable_getBoundingClientRect` gets stable 🤞. |
| 18 | +- if (ref.current.getBoundingClientRect !== null) { |
| 19 | ++ if (ref.current.getBoundingClientRect) { |
| 20 | + // @ts-ignore once it `unstable_getBoundingClientRect` gets stable. |
| 21 | + const layout = ref.current.getBoundingClientRect(); |
| 22 | + handler(layout); |
| 23 | +diff --git a/lib/module/hooks/useBoundingClientRect.js b/lib/module/hooks/useBoundingClientRect.js |
| 24 | +index a723aede9d4cfbb46f5985c531e0dae8f517aba8..c11b18b569d67fc9993ac9ab492ee1d967c24867 100644 |
| 25 | +--- a/lib/module/hooks/useBoundingClientRect.js |
| 26 | ++++ b/lib/module/hooks/useBoundingClientRect.js |
| 27 | +@@ -42,7 +42,7 @@ export function useBoundingClientRect(ref, handler) { |
| 28 | + } |
| 29 | + |
| 30 | + // @ts-ignore 👉 https://github.com/facebook/react/commit/53b1f69ba |
| 31 | +- if (ref.current.unstable_getBoundingClientRect !== null) { |
| 32 | ++ if (ref.current.unstable_getBoundingClientRect) { |
| 33 | + // @ts-ignore https://github.com/facebook/react/commit/53b1f69ba |
| 34 | + const layout = ref.current.unstable_getBoundingClientRect(); |
| 35 | + handler(layout); |
| 36 | +@@ -50,7 +50,7 @@ export function useBoundingClientRect(ref, handler) { |
| 37 | + } |
| 38 | + |
| 39 | + // @ts-ignore once it `unstable_getBoundingClientRect` gets stable 🤞. |
| 40 | +- if (ref.current.getBoundingClientRect !== null) { |
| 41 | ++ if (ref.current.getBoundingClientRect) { |
| 42 | + // @ts-ignore once it `unstable_getBoundingClientRect` gets stable. |
| 43 | + const layout = ref.current.getBoundingClientRect(); |
| 44 | + handler(layout); |
| 45 | +diff --git a/src/hooks/useBoundingClientRect.ts b/src/hooks/useBoundingClientRect.ts |
| 46 | +index cc85c8ced2de8ec514360368ed20af733f8f9aec..c551df2694ef00023a2e4616f8969ffd5e21d695 100644 |
| 47 | +--- a/src/hooks/useBoundingClientRect.ts |
| 48 | ++++ b/src/hooks/useBoundingClientRect.ts |
| 49 | +@@ -56,7 +56,7 @@ export function useBoundingClientRect( |
| 50 | + } |
| 51 | + |
| 52 | + // @ts-ignore 👉 https://github.com/facebook/react/commit/53b1f69ba |
| 53 | +- if (ref.current.unstable_getBoundingClientRect !== null) { |
| 54 | ++ if (ref.current.unstable_getBoundingClientRect) { |
| 55 | + // @ts-ignore https://github.com/facebook/react/commit/53b1f69ba |
| 56 | + const layout = ref.current.unstable_getBoundingClientRect(); |
| 57 | + handler(layout); |
| 58 | +@@ -64,7 +64,7 @@ export function useBoundingClientRect( |
| 59 | + } |
| 60 | + |
| 61 | + // @ts-ignore once it `unstable_getBoundingClientRect` gets stable 🤞. |
| 62 | +- if (ref.current.getBoundingClientRect !== null) { |
| 63 | ++ if (ref.current.getBoundingClientRect) { |
| 64 | + // @ts-ignore once it `unstable_getBoundingClientRect` gets stable. |
| 65 | + const layout = ref.current.getBoundingClientRect(); |
| 66 | + handler(layout); |
0 commit comments