Created
March 19, 2020 10:00
-
-
Save tsh-code/5b1d3d66c14d1927cc5b7229fa583806 to your computer and use it in GitHub Desktop.
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, prevState) { | |
// Always compare props or state | |
if (this.props.counter !== prevProps.counter) { | |
this.postCounter(this.props.counter); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment