deepCompare
performs a deep comparison of two objects. It automatically unwraps JS Map
s, Set
s, and ImmutableJS objects.
deepCompare(left, right)
// Will output:
// {
// isEqual: false,
// A copy-pasteable useWhyDidYouUpdate hook, adopted from the old & good usehooks.com (http://web.archive.org/web/20230203011511/https://usehooks.com/useWhyDidYouUpdate/). | |
// | |
// This hook will log whenever a component rerenders – and will print the props (or any other values | |
// you passed into it) that have changed between the rerenders. | |
// | |
// Usage: | |
// | |
// function MyComponent(props) { | |
// useWhyDidYouUpdate('MyComponent', props) | |
// |