Skip to content

Commit 3fcae9c

Browse files
author
Lionel Bertrand
committed
ref can be null in web
1 parent 5bf7f5a commit 3fcae9c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/hooks/use-scroll-handlers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ export function useScrollHandlers<T>(options?: DraggableNodeOptions) {
120120
timer.current = setTimeout(() => {
121121
const ref = resolveScrollRef(nodeRef);
122122
if (Platform.OS == 'web') {
123+
if (!ref) return;
123124
const rect = (ref as HTMLDivElement).getBoundingClientRect();
124125
(ref as HTMLDivElement).style.overflow = "auto";
125126
onMeasure(rect.x, rect.y, rect.width, rect.height, rect.left, rect.top);

0 commit comments

Comments
 (0)