Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 467 Bytes

useLogger.md

File metadata and controls

31 lines (22 loc) · 467 Bytes

useLogger

React lifecycle hook that console logs parameters as component transitions through lifecycles.

Usage

import {useLogger} from 'react-use';

const Demo = (props) => {
  useLogger('Demo', props);
  return null;
};

Example Output

Demo mounted {}
Demo updated {}
Demo unmounted

Reference

useLogger(componentName: string, ...rest);
  • componentName — component name.
  • ...rest — parameters to log.