Fixed dependency
This commit is contained in:
parent
a2af222778
commit
dc1bb19c13
1 changed files with 2 additions and 2 deletions
|
|
@ -83,10 +83,10 @@ export default function StorePage(): JSX.Element {
|
||||||
if (scrollContainer) {
|
if (scrollContainer) {
|
||||||
scrollContainer.addEventListener("scroll", handleScroll);
|
scrollContainer.addEventListener("scroll", handleScroll);
|
||||||
// Delay the initial scroll event dispatch to ensure correct calculation
|
// 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);
|
return () => scrollContainer.removeEventListener("scroll", handleScroll);
|
||||||
}
|
}
|
||||||
}, [divWidth]); // Depend on divWidth
|
}, [divWidth, loadingTags]); // Depend on divWidth
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleGetTags();
|
handleGetTags();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue