From 342a70825effbf91044fb9b90f33fda19c50f0e0 Mon Sep 17 00:00:00 2001 From: inokawa <48897392+inokawa@users.noreply.github.com> Date: Sun, 7 Jul 2024 15:53:49 +0900 Subject: [PATCH] Refactor --- src/solid/Virtualizer.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/solid/Virtualizer.tsx b/src/solid/Virtualizer.tsx index 3d10ca62..4ea391d6 100644 --- a/src/solid/Virtualizer.tsx +++ b/src/solid/Virtualizer.tsx @@ -257,9 +257,9 @@ export const Virtualizer = (props: VirtualizerProps): JSX.Element => { createComputed( on( () => props.data.length, - (len, prevLen) => { - if (exists(prevLen) && len !== prevLen) { - store._update(ACTION_ITEMS_LENGTH_CHANGE, [len, props.shift]); + (count) => { + if (count !== store._getItemsLength()) { + store._update(ACTION_ITEMS_LENGTH_CHANGE, [count, props.shift]); } } )