React lifecycle hook that console logs parameters as component transitions through lifecycles.
import {useLogger} from 'react-use';
const Demo = (props) => {
useLogger('Demo', props);
return null;
};
Demo mounted {}
Demo updated {}
Demo unmounted
useLogger(componentName: string, ...rest);
componentName
— component name....rest
— parameters to log.