useOnUpdate
Runs a callback on every component update or re-render.
The useOnUpdate
hook is helpful when you want to run a callback each time a component updates or re-renderes. The callback won’t be invoked during component mount and unmount.
For mount and unmount you can use the useOnMount and useOnUnmount hook respectively.
useOnUpdate
Count Value is : 0
Usage
Import the hook from @abhushanaj/react-hooks
and use in required component;
API Reference
Parameters
Parameter | Type | Description | Default |
---|---|---|---|
callback | ()=>void | The callback function to run after component update/re-render. | N/A |