@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) • 416 B
TypeScript
import { type EffectCallback } from 'react';
/**
* Executes a handler function only once when the component mounts, before DOM updates.
* Similar to useOnMount but uses useLayoutEffect for synchronous execution.
* Useful for DOM measurements or preventing visual flicker.
* @param handler - The function to execute on component mount
*/
export declare const useOnMountLayout: (handler: EffectCallback) => void;