Skip to content

Instantly share code, notes, and snippets.

@iliran11
Created October 20, 2018 14:50
Show Gist options
  • Save iliran11/807bb4b434853680213818d598e7c5ac to your computer and use it in GitHub Desktop.
Save iliran11/807bb4b434853680213818d598e7c5ac to your computer and use it in GitHub Desktop.
Check which prop has changed that caused re-render
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