Skip to content

useWhyDidYouUpdate ​

Help developers troubleshoot what changes have caused component rerender.

Code demonstration ​

API ​

typescript
type IProps = Record<string, any>;
useWhyDidYouUpdate(componentName: string, props: IProps): void;

Params ​

PropertyDescriptionTypeDefault
componentNameRequired, the name of the observation componentstring-
propsRequired, data to be observed (state or props and other data that may lead to rerender)Proxy<object>-

Result ​

Please open the browser console, you can see the output of the changed observed state or props.

Source ​

Source · Document · Demo

Released under the MIT License.