A React hook that runs a cleanup function when the component is unmounted.
npm install @kopexa/use-unmountA React hook that runs a cleanup function when the component is unmounted.
> This is an internal utility, not intended for public usage.
``sh`
yarn add @kopexa/use-unmountor
npm i @kopexa/use-unmount
`tsx
import { useUnmount } from '@kopexa/use-unmount';
function MyComponent() {
useUnmount(() => {
// Cleanup logic here
});
return
This hook is adapted from usehooks-ts/use-unmount with credit to the original authors.
- Website: https://kopexa.com
- GitHub: https://github.com/kopexa-grc/sight
Contributions are welcome! See the contributing guidelines for details.
This project is licensed under the terms of the MIT license.