@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
9 lines (8 loc) • 415 B
TypeScript
import type { Fn } from '../@aileron/declare';
/**
* Executes a handler function when the component unmounts, before DOM updates.
* Similar to useOnUnmount but uses useLayoutEffect for synchronous execution.
* Useful for cleanup operations that need to run before DOM mutations.
* @param handler - The function to execute on component unmount
*/
export declare const useOnUnmountLayout: (handler: Fn) => void;