UNPKG

reactuals

Version:

A useful package providing a collection of 50+ React hooks and utilities to simplify React development.

9 lines (8 loc) 296 B
/** * Temporarily sets a boolean to true, then false after duration. * * Example: * const [active, trigger] = useTimeoutToggle(2000); * return <button onClick={trigger}>{active ? "ON" : "OFF"}</button>; */ export declare function useTimeoutToggle(duration?: number): [boolean, () => void];