refactor: wrap onAnimationEnd in useCallback for stable reference

This commit is contained in:
qorexdev 2026-03-28 15:28:50 +05:00
parent 3b33a3efdb
commit 6540e3f774

View file

@ -695,6 +695,10 @@ export function OnboardingTour() {
setIsActive(false);
}, [user?.id]);
const handleAnimationEnd = useCallback(() => {
setShouldAnimate(false);
}, []);
// Handle escape key
useEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => {
@ -767,7 +771,7 @@ export function OnboardingTour() {
onSkip={handleSkip}
isDarkMode={isDarkMode}
shouldAnimate={shouldAnimate}
onAnimationEnd={() => setShouldAnimate(false)}
onAnimationEnd={handleAnimationEnd}
/>
</>
)}