Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-schrammel committed Dec 9, 2024
1 parent 4317310 commit fbf52f8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/hooks/useTimeout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export function useTimeoutEffect(
});
}, timeout);
return () => {
if (!timeoutRef.current) return;
clearTimeout(timeoutRef.current);
const elapsedTime = Date.now() - startedAt;
if (elapsedTime < timeout) {
Expand Down

0 comments on commit fbf52f8

Please sign in to comment.