13 lines
594 B
TypeScript
13 lines
594 B
TypeScript
/**
|
|
* Hook which synchronously executes a callback once the component has been mounted.
|
|
*
|
|
* `WARNING` This should only be used if you need to perform an action after the component has been mounted and
|
|
* before the browser paints. useMountSync will trigger debug warnings in server-rendered scenarios and should be used
|
|
* sparingly.
|
|
*
|
|
* @deprecated Consider to use React.useEffect() or React.useLayoutEffect() directly based on a use case
|
|
*
|
|
* @param callback - Function to call once the component has been mounted.
|
|
*/
|
|
export declare const useMountSync: (callback: () => void) => void;
|