Fixed ref type definition

This commit is contained in:
Mitchell Heddles 2019-08-23 16:23:46 +10:00
parent 698399938d
commit 99cb994d45

View File

@ -4,7 +4,7 @@ export type UseTimeoutFnReturn = [() => boolean | null, () => void, () => void];
export default function useTimeoutFn(fn: Function, ms: number = 0): UseTimeoutFnReturn {
const ready = useRef<boolean | null>(false);
const timeout = useRef(0);
const timeout = useRef<ReturnType<typeof setTimeout>>();
const isReady = useCallback(() => ready.current, []);
const set = useCallback(() => {