mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-01 04:19:12 +00:00
refactor(hooks): drop unused parameters from follow callback
Both consumers of useFollowComponent call the returned callback with no arguments, so the ref and offset overrides were dead. Removing them also drops the guard on refs that can never be falsy.
This commit is contained in:
@@ -57,14 +57,9 @@ export default function useFollowComponent({
|
||||
}
|
||||
}, [followTrigger, doFollow, followRef, scrollRef, setScrollFlag, topOffset]);
|
||||
|
||||
const scrollToRefComponent = useCallback(
|
||||
(componentRef = followRef, containerRef = scrollRef, offset?: number) => {
|
||||
if (componentRef && containerRef) {
|
||||
scrollToComponent(componentRef, containerRef, offset ?? resolveTopOffset(topOffset));
|
||||
}
|
||||
},
|
||||
[followRef, scrollRef, topOffset],
|
||||
);
|
||||
const scrollToRefComponent = useCallback(() => {
|
||||
scrollToComponent(followRef, scrollRef, resolveTopOffset(topOffset));
|
||||
}, [followRef, scrollRef, topOffset]);
|
||||
|
||||
return scrollToRefComponent;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user