UNPKG

beautiful-react-hooks

Version:

A collection of beautiful (and hopefully useful) React hooks to speed-up your components and hooks development

11 lines (10 loc) 528 B
import { GenericFunction } from './shared/types'; /** * Returns an object wrapping lifecycle hooks such as `useDidMount` or `useWillUnmount`. * It is intended as a shortcut to those hooks. */ declare const useLifecycle: <TMount extends GenericFunction = GenericFunction, TUnmount extends GenericFunction = GenericFunction>(mount?: TMount, unmount?: TUnmount) => { onDidMount: import("./shared/types").CallbackSetter<void>; onWillUnmount: import("./shared/types").CallbackSetter<void>; }; export default useLifecycle;