@kevinwang0316/use-why-did-you-update
v1.0.5
Published
A React hook to show why your component updated.
Downloads
3
Maintainers
Readme
This is not working now. Please copy the source code to your own project folder to use it for now.
UseWhyDidYouUpdate React Hook
A React Hook to show why did your component was updated. This original code was written by Bruno Lemos and I found it from Gabe Ragland's useHooks.com. Please visit this amazing website to see more useful hooks.
Installing
npm install --save @kevinwang0316/use-why-did-you-update
Usage
import useWhyDidYouUpdate from '@kevinwang0316/use-why-did-you-update';
export const yourComponent = (props) => {
useWhyDidYouUpdate('name you want', props);
return <div></div>;
};
Parameters
useWhyDidYouUpdate(name, props, isDisableProduction);
| parameter| definition| require| type |default value | | ------------- |:-------------:|:-------------:| :-------------:|:-------------:| | name| A name will show when print the difference | yes | String | ''| | props| props or stats you want to monitor | yes | Object |null| | isDisableProduction| whether disable the monitor under the production | no | Boolean |true |
Result will show in the console
License
RedisHelper is licensed under MIT License - see the License file.