fix: Adjust useSticyScroll hook dependency arrays

This commit is contained in:
João Victor 2024-10-21 15:15:01 -03:00
parent 7584c63ee6
commit e4d6720b68

View File

@ -51,20 +51,20 @@ const useStickyScroll = (
}
});
});
}, [stickyElement]);
}, [stickyElement, operator]);
handlers.current.startObserving = useCallback(() => {
if (!onResizeOf) return;
clearTimeout(timeout.current);
observer.current?.observe(onResizeOf);
}, [onResizeOf, observer.current]);
}, [onResizeOf]);
handlers.current.stopObserving = useCallback(() => {
if (!onResizeOf) return;
timeout.current = setTimeout(() => {
observer.current?.unobserve(onResizeOf);
}, 500);
}, [onResizeOf, observer.current]);
}, [onResizeOf]);
useEffect(
() => () => {