title: React auth using useState for route
body: <p>I'm trying in a personal project
  to learn react not to use redux only
  hooks.
  So I've got a simply custom hook</p>
  <pre><code>const useAuth = () =&gt; {
    const [isAuthenticated, setIsAuthenticated] = useState(false);
    return { isAuthenticated, setIsAuthenticated };
  };
  </code></pre>
  <p>to use for set the auth to true</p>
  <p>but it doesn't work.</p>
  <p>Here you can see an example</p>
  <p><a href="https://stackblitz.com/edit/react-rky7dn?file=src%2Flogin.js" rel="nofollow noreferrer">https://stackblitz.com/edit/react-rky7dn?file=src%2Flogin.js</a></p>
  <p>Can anyone tell me what's wrong please?</p>