fix: anchorRef.current may undefined

pull/13892/head
Joel 1 year ago
parent 95e2e038e1
commit 5e579322ae

@ -66,9 +66,9 @@ const Datasets = ({
useEffect(() => { useEffect(() => {
const onScroll = debounce(() => { const onScroll = debounce(() => {
if (!loadingStateRef.current) { if (!loadingStateRef.current && containerRef.current && anchorRef.current) {
const { scrollTop, clientHeight } = containerRef.current! const { scrollTop, clientHeight } = containerRef.current!
const anchorOffset = anchorRef.current!.offsetTop const anchorOffset = anchorRef.current.offsetTop
if (anchorOffset - scrollTop - clientHeight < 100) if (anchorOffset - scrollTop - clientHeight < 100)
setSize(size => size + 1) setSize(size => size + 1)
} }

Loading…
Cancel
Save