fix: Adjust useSticyScroll hook dependency arrays
This commit is contained in:
parent
7584c63ee6
commit
e4d6720b68
@ -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(
|
||||
() => () => {
|
||||
|
Loading…
Reference in New Issue
Block a user