@kopexa/use-unmount
v17.0.1
Published
A React hook that runs a cleanup function when the component is unmounted.
Keywords
Readme
@kopexa/use-unmount
A React hook that runs a cleanup function when the component is unmounted.
This is an internal utility, not intended for public usage.
Installation
yarn add @kopexa/use-unmount
# or
npm i @kopexa/use-unmountUsage
import { useUnmount } from '@kopexa/use-unmount';
function MyComponent() {
useUnmount(() => {
// Cleanup logic here
});
return <div>...</div>;
}Credits
This hook is adapted from usehooks-ts/use-unmount with credit to the original authors.
About kopexa
- Website: https://kopexa.com
- GitHub: https://github.com/kopexa-grc/sight
Contribution
Contributions are welcome! See the contributing guidelines for details.
License
This project is licensed under the terms of the MIT license.
