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