useeffectlogger
v1.0.5
Published
Drop-in hook to debug what is triggering a useEffect hook
Downloads
4
Maintainers
Readme
useEffectLogger
This is a custom React hook that is a drop in replacement for the useEffect
hook. It will log the index of the variable that triggered the hook, the before and after value of the variable in a table.
npm i useeffectlogger
import useEffectLogger from 'useEffectLogger'
//change useEffect to useEffectLogger
// useEffect(()=>{
// },[user,password])
useEffectLogger(()=>{
},[user,password])
This will be logged in the console when the user
variable has changed in the above example.
|(index)|before|after| |---|---|---| |0|"usernam"|"username"|