From dc1bb19c1310499317e19529b61b335d9cb086a3 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Sat, 18 Nov 2023 01:57:12 -0300 Subject: [PATCH] Fixed dependency --- src/frontend/src/pages/StorePage/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/pages/StorePage/index.tsx b/src/frontend/src/pages/StorePage/index.tsx index 11ce76a41..40f4877ad 100644 --- a/src/frontend/src/pages/StorePage/index.tsx +++ b/src/frontend/src/pages/StorePage/index.tsx @@ -83,10 +83,10 @@ export default function StorePage(): JSX.Element { if (scrollContainer) { scrollContainer.addEventListener("scroll", handleScroll); // Delay the initial scroll event dispatch to ensure correct calculation - setTimeout(() => scrollContainer.dispatchEvent(new Event("scroll")), 200); + scrollContainer.dispatchEvent(new Event("scroll")); return () => scrollContainer.removeEventListener("scroll", handleScroll); } - }, [divWidth]); // Depend on divWidth + }, [divWidth, loadingTags]); // Depend on divWidth useEffect(() => { handleGetTags();