useUnmount

Custom hook that runs a cleanup function when the component is unmounted.

Custom hook that runs a cleanup function when the component is unmounted.

Usage

import { useUnmount } from "@tilt-legal/cubitt-components/utilities/hooks";

useUnmount(() => {
  // Cleanup logic here
});

API

Signature

declare function useUnmount(func: () => void): void;

Parameters

ParameterTypeDescriptionDefault
func() => voidThe cleanup function to be executed on unmount.-

Return Value

ValueTypeDescription
returnvoidValue returned by the hook.

On this page