mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
Merge pull request #1184 from mvanhorn/fix/cancel-animation-frame-cleanup
fix: add cancelAnimationFrame cleanup in animated-tabs useEffect
This commit is contained in:
commit
36908241f1
1 changed files with 2 additions and 1 deletions
|
|
@ -310,7 +310,8 @@ const TabsList = forwardRef<
|
|||
}, [updateActiveIndicator]);
|
||||
|
||||
useEffect(() => {
|
||||
requestAnimationFrame(updateActiveIndicator);
|
||||
const id = requestAnimationFrame(updateActiveIndicator);
|
||||
return () => cancelAnimationFrame(id);
|
||||
}, [updateActiveIndicator]);
|
||||
|
||||
const scrollTabToCenter = useCallback((index: number) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue