title: Is it possible to use ClearInterval inside static getDerivedStateFromPRops method in React?
body: <p>I have set an Interval and did some Operation inside ComponentDidMount method. I want to clear the Interval after I get props.status is completed.</p>
  
  <pre><code>class A extends React.PureComponent {
   constructor(props) {
    super(props);
    this.intervalTimer = '';
  }
  
  componentDidMount() {
    this.intervalTimer = setTimeout(() =&gt; {
      // do something;
  }, 3000);
  }
  
  static getDerivedStateFromProps(np, ps) {
   if(np.status === 'completed') {
    clearInterval(A.intervalTimer);
  }
  }
  }
  </code></pre>