]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-16299 Replace React legacy lifecycle methods in GraphsHistory
authorMathieu Suen <mathieu.suen@sonarsource.com>
Mon, 25 Apr 2022 08:53:20 +0000 (10:53 +0200)
committersonartech <sonartech@sonarsource.com>
Mon, 25 Apr 2022 20:02:45 +0000 (20:02 +0000)
server/sonar-web/src/main/js/components/activity-graph/GraphsHistory.tsx

index 46713bed9f5528fe2affe5d87fec7aae38b275d2..a644e8e3a35b307fb88d361a238df15882b912af 100644 (file)
@@ -56,9 +56,9 @@ export default class GraphsHistory extends React.PureComponent<Props, State> {
     };
   }
 
-  componentWillReceiveProps(nextProps: Props) {
-    if (!isEqual(nextProps.selectedDate, this.props.selectedDate)) {
-      this.setState({ selectedDate: nextProps.selectedDate });
+  componentDidUpdate(prevProps: Props) {
+    if (!isEqual(prevProps.selectedDate, this.props.selectedDate)) {
+      this.setState({ selectedDate: this.props.selectedDate });
     }
   }