title: Having more than one condition in getDerivedStateFromProps in React
body: <p>In my React application, I have the following code.</p>
  
  <pre><code>state = {
     credentialDeletion: false,
     accountDeletion: false
  }
  
  static getDerivedStateFromProps(nextProps) {
     if (nextProps.accountDeleting) {
        return {
           accountDeletion: true
        }
     }
  
     if (nextProps.credentialDeletion) {
        return {
           credentialDeletion: true
        }
     }
  
     return null;
  }
  </code></pre>
  
  <p>But this code doesn't work properly. If I remove one condition, then the other works fine. But together, only the first condition works. How should I write this code properly?</p>