initialising and error not working on Auth Hook
See original GitHub issueJust tried the example you provided
import { useAuthState } from 'react-firebase-hooks/auth';
const CurrentUser = () => {
const [user, initialising, error] = useAuthState(firebase.auth());
const login = () => {
firebase.auth().signInWithEmailAndPassword('test@test.com', 'password');
};
const logout = () => {
firebase.auth().signOut();
};
if (initialising) {
return (
<div>
<p>Initialising User...</p>
</div>
);
}
if (error) {
return (
<div>
<p>Error: {error}</p>
</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>;
};
Same result. Uncaught error. Using v2.1.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
loading and error not working on Auth Hook · Issue #85 - GitHub
You can solve the problem by using catch() in your signInWithEmailAndPassword method, plus the error which the hook provides is just when your ......
Read more >Why react firebase hook do not working to show error in sign ...
I tried several times to display error.message but do not showing anything and in console error is showing false when I made any...
Read more >How to Set Up GitHub User Authentication using Firebase and ...
In this tutorial, I will walk you through the process of creating a GitHub User Authentication System using Firebase and React (with hooks)....
Read more >Auth0 React SDK Quickstarts: Login
Auth0 allows you to add authentication to your React application quickly and to gain access to user profile information. This guide demonstrates how...
Read more >5 Most Common useState Mistakes React Developers Often ...
Initiating the useState hook incorrectly is one of the most common mistakes developers make when utilizing it. What does it mean to initialize ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i am having the same issue. the
initialising
anderror
variables does not re-render the component when they are changedSame here. What is happening?