Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
linxianxi committed Feb 7, 2024
1 parent 1692773 commit 19cac05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stickyScrollBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ const StickyScrollBar: React.ForwardRefRenderFunction<unknown, StickyScrollBarPr
}, [scrollState.isHiddenScrollBar]);

// The best way is to use ResizeObserver to detect the body height, but this way is enough
const bodyHeight = scrollBodyRef.current.offsetHeight;
const bodyHeight = scrollBodyRef.current?.offsetHeight;
React.useEffect(() => {
checkScrollBarVisible();
}, [bodyHeight]);
Expand Down

0 comments on commit 19cac05

Please sign in to comment.