File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,17 +55,20 @@ export function useBoundingClientRect(
5555 return ;
5656 }
5757
58- // @ts -ignore 👉 https://github.com/facebook/react/commit/53b1f69ba
59- if ( ref . current . unstable_getBoundingClientRect !== null ) {
60- // @ts -ignore https://github.com/facebook/react/commit/53b1f69ba
58+ // @ts -expect-error 👉 https://github.com/facebook/react/commit/53b1f69ba
59+ if (
60+ ref . current . unstable_getBoundingClientRect !== null &&
61+ typeof ref . current . unstable_getBoundingClientRect === 'function'
62+ ) {
63+ // @ts -expect-error https://github.com/facebook/react/commit/53b1f69ba
6164 const layout = ref . current . unstable_getBoundingClientRect ( ) ;
6265 handler ( layout ) ;
6366 return ;
6467 }
6568
66- // @ts -ignore once it `unstable_getBoundingClientRect` gets stable 🤞.
69+ // @ts -expect-error once it `unstable_getBoundingClientRect` gets stable 🤞.
6770 if ( ref . current . getBoundingClientRect !== null ) {
68- // @ts -ignore once it `unstable_getBoundingClientRect` gets stable.
71+ // @ts -expect-error once it `unstable_getBoundingClientRect` gets stable.
6972 const layout = ref . current . getBoundingClientRect ( ) ;
7073 handler ( layout ) ;
7174 }
You can’t perform that action at this time.
0 commit comments