title: useEffect only fires at first render when I use a switch statement
body: <p>Can someone please explain why the following first example renders only once at the start, but the second works as expected and renders when the window is resized to be smaller/larger than 650px:</p>
  
  <p>Doesn't work:</p>
  
  <pre><code>function useWindowResize() {
    const [width, setWindowWidth] = useState(getWindowSize(window.innerWidth))
    useEffect(() =&gt; {
      const handleResize = () =&gt; setWindowWidth(getWindowSize(window.innerWidth))
      window.addEventListener('resize', handleResize)
      return () =&gt; {
        window.removeEventListener('resize', handleResize)
      }
    }, )
    return width
  }
  
  function getWindowSize(size) {
    switch (size) {
      case (size &gt;= 650):
        return 'lrg'
      default:
        return 'sml'
    }
  }
  </code></pre>
  
  <p>Works:</p>
  
  <pre><code>function useWindowResize() {
    const [width, setWindowWidth] = useState(window.innerWidth &lt; 650 ? true : false)
    useEffect(() =&gt; {
      const handleResize = () =&gt; setWindowWidth(window.innerWidth &lt; 650 ? true : false)
      window.addEventListener('resize', handleResize)
      return () =&gt; {
        window.removeEventListener('resize', handleResize)
      }
    }, )
    return width
  }
  </code></pre>
  
  <p>Some component file:</p>
  
  <pre><code>export default () =&gt; {
   const width = useWindowResize()  
   console.log(width) //Second example updates first doesn't
    return(...)
  }
  </code></pre>