Created
October 20, 2018 14:50
-
-
Save iliran11/807bb4b434853680213818d598e7c5ac to your computer and use it in GitHub Desktop.
Check which prop has changed that caused re-render
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) { | |
for (const index in prevProps) { | |
if (prevProps[index] !== this.props[index]) { | |
console.log(index, this.props[index], '-->', prevProps[index]); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment