Closed thanhtutzaw closed 2 years ago
I believe your issue is that you are mixing v8 and v0 implementations. firebase.initializeApp(...)
is the v8 way of doing initialize and getAuth
is v9 (previously firebase.auth()
)
In the second example, you want to import initializeApp from firebase version 9 like so:
import { initializeApp } from 'firebase/app';
=
Then use it like
const app = initializeApp(config);
Then in v9, you export app instead of firebase
export default app;
Then, in the components that use auth you use
const auth = getAuth(app)
Yeah I changed code like this . And it works
import { getAuth } from 'firebase/auth';
<StyledFirebaseAuth firebaseAuth={getAuth()} />
I called styledfirebaseui in my firebase-auth component. That component knows my Firebase initalize and Styledfirebaseui don't know . But when I initalize again it says This is duplicate.
This successfully work with Firebase v8
Current Version