diff --git a/src/hooks/useTimeout.ts b/src/hooks/useTimeout.ts index a3f8f3f..6dbfbce 100644 --- a/src/hooks/useTimeout.ts +++ b/src/hooks/useTimeout.ts @@ -20,6 +20,8 @@ export default function useTimeout(callback: () => void, delay?: number) { if (delay) { timeoutRef.current = window.setTimeout(tick, delay) return () => window.clearTimeout(timeoutRef.current as number) + } else { + return () => {} // makes TS happy to have an explicit return } }, [delay])