Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react componentDidUpdate

componentDidUpdate(prevProps) {
  // Typical usage (don't forget to compare props):
  if (this.props.userID !== prevProps.userID) {
    this.fetchData(this.props.userID);
  }
}
Source by reactjs.org #
 
PREVIOUS NEXT
Tagged: #react #componentDidUpdate
ADD COMMENT
Topic
Name
1+5 =