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.