Created
February 27, 2018 12:49
-
-
Save atmd83/0ba42d47e8b8273e0d9b53296872aa76 to your computer and use it in GitHub Desktop.
medium post updated shouldComponentUpdate
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
shouldComponentUpdate(nextProps, nextState) { | |
if (this.props.value !== nextProps.value) { | |
PubSub.publish('thing.should.update'); | |
return true; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment