Skip to main content

useUnmount

Run callback when the component is being unmounted.

Parameters

  • callback (function): The function to run after the initial render.

Example

import { useUnmount } from '@atomicjolt/hooks';

function MyComponent() {
useUnmount(() => {
console.log('Unmounting!');
});

return <div>My Component</div>;
}