title: I cannot use useSelector() on React/Redux
body: <p>I have the following code which I want to return the state to be used for private routes on React Router (allowing the access when <code>isAuthenticated()</code> returns true).</p>
  
  <pre><code>import React from 'react'
  import { useSelector } from 'react-redux'
  
  export const isAuthenticated = () =&gt; {
  
      const auth = useSelector(state =&gt; state)
  
      return auth
  }
  </code></pre>
  
  <p>But I'm getting this error:</p>
  
  <pre><code>Line 6:  React Hook "useSelector" is called in function "isAuthenticated" which is neither a React function component or a custom React Hook function
  </code></pre>
  
  <p>I don't know how to fix it. Does anyone know? Thanks</p>