mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(boards-bar): cancel debounced scroll handler on cleanup
This commit is contained in:
@@ -398,7 +398,10 @@ const BoardsBarMobile = ({ subplebbitAddress }: { subplebbitAddress?: string })
|
||||
|
||||
window.addEventListener('scroll', debouncedHandleScroll, { passive: true });
|
||||
|
||||
return () => window.removeEventListener('scroll', debouncedHandleScroll);
|
||||
return () => {
|
||||
window.removeEventListener('scroll', debouncedHandleScroll);
|
||||
debouncedHandleScroll.cancel();
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user