UNPKG

track-dependancy-changes

Version:

A lightweight React utility that tracks the changes in component dependencies before and after each render. It also shows the number of times a component has re-rendered, and allows aliasing of dependency names for easier readability.

9 lines (8 loc) 440 B
/** * Custom hook to track and log dependency changes in a React component. * @param dependencies Array of dependencies to track. * @param labels Optional array of labels for dependencies (for readability in logs). * @param componentName Optional component name for more informative logs. */ declare const useTrackDependency: (dependencies: any[], labels?: string[], componentName?: string) => void; export default useTrackDependency;