@winglet/react-utils
Version:
React utility library providing custom hooks, higher-order components (HOCs), and utility functions to enhance React application development with improved reusability and functionality
8 lines (7 loc) • 331 B
TypeScript
import type { Fn } from '../@aileron/declare';
/**
* Executes a handler function when the component unmounts.
* Equivalent to returning a cleanup function from useEffect with an empty dependency array.
* @param handler - The function to execute on component unmount
*/
export declare const useOnUnmount: (handler: Fn) => void;