From 676dd6490b8a47faeffe7b680c74be2e0d599769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?lich=28=E6=9D=8E=E6=98=A5=E7=BF=AF=29?= Date: Thu, 26 Aug 2021 11:11:22 +0800 Subject: [PATCH] fix: read property getBoundingClientRect of null when unmount --- src/stickyScrollBar.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/stickyScrollBar.tsx b/src/stickyScrollBar.tsx index 06af5e8d9..2cd39865b 100644 --- a/src/stickyScrollBar.tsx +++ b/src/stickyScrollBar.tsx @@ -80,6 +80,9 @@ const StickyScrollBar: React.ForwardRefRenderFunction { + if (!scrollBodyRef.current) { + return; + } const tableOffsetTop = getOffset(scrollBodyRef.current).top; const tableBottomOffset = tableOffsetTop + scrollBodyRef.current.offsetHeight; const currentClientOffset =