-
Notifications
You must be signed in to change notification settings - Fork 306
Closed
Description
Hi,
I've been trying the useAuthState
hook and looks like the initialising
variable is not working.
Here is the code:
export default function Login() {
const { initialising, user } = useAuthState(firebaseAuth());
const login = () => {
firebaseAuth().signInWithEmailAndPassword('[email protected]', 'test123');
};
const logout = () => { firebaseAuth().signOut(); };
if (initialising) {
return (
<div>
<Spinner marginX="auto" marginY={50} />
</div>
)
}
if (user) {
return (
<div>
<p>Current User: {user.email}</p>
<Button onClick={logout}>Log out</Button>
</div>
);
}
return (
<Button onClick={login}>Log in</Button>
)
}
The login/logout works fine, but I've confirmed that the initialising
block is never reached.
Thanks in advance,
Geraldo
Metadata
Metadata
Assignees
Labels
No labels