useTimeout
Use a setTimeout (opens in a new tab) state with some methods to control it.
Type Definitions
import { DependencyList } from 'react';
const useTimeout: (args: {
callback?: () => any;
timeout: number;
startOnMount?: boolean;
deps?: DependencyList;
}) => {
isActive: boolean;
start(): void;
cancel(): void;
toggle(force?: boolean): void;
};