From 487f8a2fb2d13e1ab31ad4e4af4f45630348be95 Mon Sep 17 00:00:00 2001 From: Shubham Rathi <40445744+ishubhamrathi@users.noreply.github.com> Date: Wed, 29 Jul 2026 10:11:49 +0530 Subject: [PATCH 1/2] Fixes the animation loop getting stuck due to a stale requestAnimationFrame guard. Related issue: https://github.com/DavidHDev/react-bits/issues/1014 --- src/tailwind/Components/OptionWheel/OptionWheel.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tailwind/Components/OptionWheel/OptionWheel.jsx b/src/tailwind/Components/OptionWheel/OptionWheel.jsx index f696f55f..fc54e940 100644 --- a/src/tailwind/Components/OptionWheel/OptionWheel.jsx +++ b/src/tailwind/Components/OptionWheel/OptionWheel.jsx @@ -127,7 +127,10 @@ const OptionWheel = ({ }, []); const startLoop = useCallback(() => { - if (rafRef.current != null) return; + if (rafRef.current != null) { + cancelAnimationFrame(rafRef.current); + } + lastRef.current = performance.now(); rafRef.current = requestAnimationFrame(runFrame); }, [runFrame]); From 83ccc371121dc563569c695e183191e2c34eac61 Mon Sep 17 00:00:00 2001 From: Shubham Rathi <40445744+ishubhamrathi@users.noreply.github.com> Date: Wed, 29 Jul 2026 10:12:54 +0530 Subject: [PATCH 2/2] Prevent multiple animation frames in startLoop Cancel the existing animation frame before starting a new one. --- src/content/Components/LineSidebar/LineSidebar.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/content/Components/LineSidebar/LineSidebar.jsx b/src/content/Components/LineSidebar/LineSidebar.jsx index 0266d7c1..8d1756b0 100644 --- a/src/content/Components/LineSidebar/LineSidebar.jsx +++ b/src/content/Components/LineSidebar/LineSidebar.jsx @@ -84,7 +84,10 @@ const LineSidebar = ({ }, []); const startLoop = useCallback(() => { - if (rafRef.current != null) return; + if (rafRef.current != null) { + cancelAnimationFrame(rafRef.current); + } + lastRef.current = performance.now(); rafRef.current = requestAnimationFrame(runFrame); }, [runFrame]);