diff --git a/src/useDebounce.ts b/src/useDebounce.ts index 7db978c274..4b3cd9baee 100644 --- a/src/useDebounce.ts +++ b/src/useDebounce.ts @@ -1,11 +1,11 @@ import { useState, useEffect } from 'react'; const useDebounce = (fn: () => any, ms: number = 0, args: Array = []) => { - const [timeout, setTimeoutVar] = useState(null); + const [timeout, setTimeoutVar] = useState(null); useEffect(() => { // if args change then clear timeout - clearTimeout(timeout!); + clearTimeout(timeout); const t = setTimeout(fn.bind(null, args), ms); setTimeoutVar(t); }, args);