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