Created
June 20, 2017 09:21
-
-
Save lowiebenoot/e3dbc529380b6a4a1a5c00edec136142 to your computer and use it in GitHub Desktop.
Log why a react component rendered
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
componentDidUpdate(prevProps) { | |
Object.keys(this.props).forEach(key => { | |
if (this.props[key] !== prevProps[key]) { | |
console.log(key, "changed from", prevProps[key], "to", this.props[key]); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment