Answers for "prev props"

0

prev props

componentDidUpdate(prevProps) {
  // Utilisation classique (pensez bien à comparer les props) :
  if (this.props.userID !== prevProps.userID) {
    this.fetchData(this.props.userID);
  }
}
Posted by: Guest on June-29-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language