title: Replacing getDerivedStateFromProps with useEffect
body: <p>I'm converting a class component to a function component and wanted to see if <code>useEffect()</code> could replace the following static function</p>
  
  <pre><code>static getDerivedStateFromProps(props) {
      const { path } = props.match;
      if (path === '/login') {
        return { loginStatus: true };
      } else {
        return { loginStatus: false };
      }
    }
  </code></pre>
  
  <p>Following is the new replacement function.  It's doing what it's supposed to be doing, which is to change the state according to the props, but I'm not too familiar with useEffect() and I'm just wondering if I'm not losing anything by converting to this. </p>
  
  <pre><code>const { path } = props.match
  useEffect(() =&gt; {
      if (path ==='/login'){
          setLoginStatus(true)
      } else {
      setLoginStatus(false)
      }
  }, [ path ])
  </code></pre>