Merge pull request #1184 from mvanhorn/fix/cancel-animation-frame-cleanup

fix: add cancelAnimationFrame cleanup in animated-tabs useEffect
This commit is contained in:
Rohan Verma 2026-04-08 02:03:01 -07:00 committed by GitHub
commit 36908241f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -310,7 +310,8 @@ const TabsList = forwardRef<
}, [updateActiveIndicator]);
useEffect(() => {
requestAnimationFrame(updateActiveIndicator);
const id = requestAnimationFrame(updateActiveIndicator);
return () => cancelAnimationFrame(id);
}, [updateActiveIndicator]);
const scrollTabToCenter = useCallback((index: number) => {