Skip to main content

useUnmount

Run effect on the component unmount.

API

function useUnmount(effect: () => void): void;

Example

import React from "react";
import { useUnmount } from "@lilib/hooks";

function Example() {
useUnmount(() => {
console.log("Component will unmount");
});
...
}