We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 377d2de commit 727eb03Copy full SHA for 727eb03
1 file changed
src/hooks/useBoundingClientRect.ts
@@ -67,8 +67,12 @@ export function useBoundingClientRect(
67
return;
68
}
69
70
- // @ts-expect-error once it `unstable_getBoundingClientRect` gets stable 🤞.
71
- if (ref.current.getBoundingClientRect !== null) {
+ if (
+ // @ts-expect-error once it `unstable_getBoundingClientRect` gets stable 🤞.
72
+ ref.current.getBoundingClientRect !== null &&
73
74
+ typeof ref.current.getBoundingClientRect === 'function'
75
+ ) {
76
// @ts-expect-error once it `unstable_getBoundingClientRect` gets stable.
77
const layout = ref.current.getBoundingClientRect();
78
handler(layout);
0 commit comments