Last active
November 6, 2017 21:45
-
-
Save ryanflorence/756608f0b3fc1358c285e28895adcd32 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// put this at the top of your app | |
const setState = Component.prototype.setState | |
Component.prototype.setState = function(nextState) { | |
console.group(this.constructor.name) | |
console.trace() | |
if (this.shouldComponentUpdate) { | |
console.log('shouldComponentUpdate', ( | |
this.shouldComponentUpdate(this.props, nextState) | |
)) | |
} | |
console.log('props', this.props) | |
console.log('state', this.state) | |
console.log('nextState', nextState) | |
console.groupEnd(this.constructor.name) | |
return setState.apply(this, arguments) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment