title: React: Where to put API call to be made on state change
body: <p>I need to make an API call on state change in react</p>
  
  <p>Which lifecycle method should I put this API call in?</p>
  
  <p><code>componentDidUpdate()</code>, <code>getDerivedStateFromProps()</code> or any other?</p>
  
  <p>What is the best practice?</p>