useUnmount

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

Usage

import { useUnmount } from "@teasim/hooks";
export default function Component() {
useUnmount(() => {
// Cleanup logic here
});
return <div>Hello world</div>;
}