title: Why use getDerivedStateFromProps when you have componentDidUpdate?
body: <p>I'm confused about the new lifecycle of react 16, getDerivedStateFromProps use case. Take below code for example, getDerivedStateFromProps is not needed at all since I can achieve what I want with componentDidUpdate.</p>
  
  <pre><code>export class ComponentName extends Component {
    //what is this for?
    static getDerivedStateFromProps(nextProps, prevState) {
  
      if (nextProps.filtered !== prevState.filtered &amp;&amp; nextProps.filtered === 'updated') {
        return {
          updated: true //set state updated to true, can't do anything more?
        };
      }
  
      return null;
  
    }
  
    componentDidUpdate(prevProps, prevState) {
      if(prevProps.filtered !== this.state.filtered &amp;&amp; this.state.filtered === 'updated'){
        console.log('do something like fetch api call, redirect, etc..')
      }
    }
  
    render() {
      return (
        &lt;div&gt;&lt;/div&gt;
      );
    }
  }
  </code></pre>