From 6239b6bd4c8305be26ea3746dd3746148f3da7ee Mon Sep 17 00:00:00 2001 From: pinpong Date: Tue, 23 Sep 2025 09:53:11 +0700 Subject: [PATCH 1/4] fix: getBoundingClientRect null check --- package.json | 3 ++- src/hooks/useBoundingClientRect.ts | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 63565edbb..965e90dfe 100644 --- a/package.json +++ b/package.json @@ -94,5 +94,6 @@ }, "overrides": { "conventional-changelog-conventionalcommits": "8.0.0" - } + }, + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/src/hooks/useBoundingClientRect.ts b/src/hooks/useBoundingClientRect.ts index cc85c8ced..81f9e854c 100644 --- a/src/hooks/useBoundingClientRect.ts +++ b/src/hooks/useBoundingClientRect.ts @@ -55,17 +55,17 @@ export function useBoundingClientRect( return; } - // @ts-ignore 👉 https://github.com/facebook/react/commit/53b1f69ba - if (ref.current.unstable_getBoundingClientRect !== null) { - // @ts-ignore https://github.com/facebook/react/commit/53b1f69ba + // @ts-expect-error 👉 https://github.com/facebook/react/commit/53b1f69ba + if (ref.current.unstable_getBoundingClientRect != null) { + // @ts-expect-error https://github.com/facebook/react/commit/53b1f69ba const layout = ref.current.unstable_getBoundingClientRect(); handler(layout); return; } - // @ts-ignore once it `unstable_getBoundingClientRect` gets stable 🤞. - if (ref.current.getBoundingClientRect !== null) { - // @ts-ignore once it `unstable_getBoundingClientRect` gets stable. + // @ts-expect-error once it `unstable_getBoundingClientRect` gets stable 🤞. + if (ref.current.getBoundingClientRect != null) { + // @ts-expect-error once it `unstable_getBoundingClientRect` gets stable. const layout = ref.current.getBoundingClientRect(); handler(layout); } From e70fa90342bd782a2c819bc0adc1f90dbe29bd75 Mon Sep 17 00:00:00 2001 From: Oliver Nitzschke Date: Thu, 25 Sep 2025 23:10:39 +0700 Subject: [PATCH 2/4] Update package.json --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 965e90dfe..63565edbb 100644 --- a/package.json +++ b/package.json @@ -94,6 +94,5 @@ }, "overrides": { "conventional-changelog-conventionalcommits": "8.0.0" - }, - "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" + } } From a30569be9cc89c25f9c06496b1e118ee81d215bd Mon Sep 17 00:00:00 2001 From: Oliver Nitzschke Date: Thu, 25 Sep 2025 23:12:22 +0700 Subject: [PATCH 3/4] Update useBoundingClientRect.ts --- src/hooks/useBoundingClientRect.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/useBoundingClientRect.ts b/src/hooks/useBoundingClientRect.ts index 81f9e854c..f682bda11 100644 --- a/src/hooks/useBoundingClientRect.ts +++ b/src/hooks/useBoundingClientRect.ts @@ -55,7 +55,7 @@ export function useBoundingClientRect( return; } - // @ts-expect-error 👉 https://github.com/facebook/react/commit/53b1f69ba + // @ts-ignore 👉 https://github.com/facebook/react/commit/53b1f69ba if (ref.current.unstable_getBoundingClientRect != null) { // @ts-expect-error https://github.com/facebook/react/commit/53b1f69ba const layout = ref.current.unstable_getBoundingClientRect(); @@ -63,7 +63,7 @@ export function useBoundingClientRect( return; } - // @ts-expect-error once it `unstable_getBoundingClientRect` gets stable 🤞. + // @ts-ignore once it `unstable_getBoundingClientRect` gets stable 🤞. if (ref.current.getBoundingClientRect != null) { // @ts-expect-error once it `unstable_getBoundingClientRect` gets stable. const layout = ref.current.getBoundingClientRect(); From 26eb23e8d976adc20a3353b64006aaac27fe2dac Mon Sep 17 00:00:00 2001 From: Oliver Nitzschke Date: Thu, 25 Sep 2025 23:13:25 +0700 Subject: [PATCH 4/4] Update useBoundingClientRect.ts --- src/hooks/useBoundingClientRect.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/useBoundingClientRect.ts b/src/hooks/useBoundingClientRect.ts index f682bda11..f156cc473 100644 --- a/src/hooks/useBoundingClientRect.ts +++ b/src/hooks/useBoundingClientRect.ts @@ -57,7 +57,7 @@ export function useBoundingClientRect( // @ts-ignore 👉 https://github.com/facebook/react/commit/53b1f69ba if (ref.current.unstable_getBoundingClientRect != null) { - // @ts-expect-error https://github.com/facebook/react/commit/53b1f69ba + // @ts-ignore https://github.com/facebook/react/commit/53b1f69ba const layout = ref.current.unstable_getBoundingClientRect(); handler(layout); return; @@ -65,7 +65,7 @@ export function useBoundingClientRect( // @ts-ignore once it `unstable_getBoundingClientRect` gets stable 🤞. if (ref.current.getBoundingClientRect != null) { - // @ts-expect-error once it `unstable_getBoundingClientRect` gets stable. + // @ts-ignore once it `unstable_getBoundingClientRect` gets stable. const layout = ref.current.getBoundingClientRect(); handler(layout); }