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
| Parameter | Type | Description | Default |
|---|---|---|---|
func | () => void | The cleanup function to be executed on unmount. | - |
Return Value
| Value | Type | Description |
|---|---|---|
return | void | Value returned by the hook. |