@bscop/use-did-mount
v2.0.6
Published
React hook to handle componentDidMount, and componentWillUnmount lifecycle events.
Downloads
132
Maintainers
Readme
@bscop/use-did-mount
React hook to handle componentDidMount, and componentWillUnmount lifecycle events.
Install
npm i @bscop/use-did-mount
Usage
import useDidMount from "@bscop/use-did-mount";
useDidMount(
function onMount () {
console.log("Yay, component is mounted");
return function onUnmount () {
console.log("Yay, component is unmounted");
}
},
);
Contribute
Read the guidelines.
Run tests
npm test
Coverage
Coverage reports are hosted on codecov.
npm run badge:coverage -- --token=<guid>
Bruno Scopelliti
www.brunoscopelliti.com