@supunlakmal/hooks
Version:
A collection of reusable React hooks
10 lines (9 loc) • 357 B
TypeScript
/**
* Returns a function that returns the current mount state. This hook is useful when you have to
* detect component mount state within async effects.
*
* @param initialValue Initial value.
*
* @return Function that returns `true` only if the component is mounted.
*/
export declare const useIsMounted: (initialValue?: boolean) => (() => boolean);