Custom hook that runs a cleanup function when the component is unmounted.
import { useUnmount } from "@teasim/hooks"; export default function Component() { useUnmount(() => { // Cleanup logic here }); return <div>Hello world</div>; }