From d01f874eac3de036f83affb16cc582e3e64d9b59 Mon Sep 17 00:00:00 2001 From: Tim Thuma <30806431+tthuma1@users.noreply.github.com> Date: Fri, 25 Jul 2025 13:53:29 +0200 Subject: [PATCH] chore: removed unused stackTop --- src/hooks/useScrollTo.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/hooks/useScrollTo.tsx b/src/hooks/useScrollTo.tsx index eadfdf5..d1f9c3c 100644 --- a/src/hooks/useScrollTo.tsx +++ b/src/hooks/useScrollTo.tsx @@ -71,7 +71,6 @@ export default function useScrollTo( const mergedAlign = targetAlign || originAlign; // Get top & bottom - let stackTop = 0; let itemTop = 0; let itemBottom = 0; @@ -79,11 +78,9 @@ export default function useScrollTo( for (let i = 0; i <= maxLen; i += 1) { const key = getKey(data[i]); - itemTop = stackTop; + itemTop = itemBottom; const cacheHeight = heights.get(key); itemBottom = itemTop + (cacheHeight === undefined ? itemHeight : cacheHeight); - - stackTop = itemBottom; } // Check if need sync height (visible range has item not record height)