firebase / firebaseui-web-react

React Wrapper for firebaseUI Web
Apache License 2.0
1.27k stars 250 forks source link

Styledfirebaseui don't know my initializaion #177

Closed thanhtutzaw closed 2 years ago

thanhtutzaw commented 2 years ago

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

Screenshot (1123) Screenshot (1126)

kicksent commented 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)

thanhtutzaw commented 2 years ago

Yeah I changed code like this . And it works import { getAuth } from 'firebase/auth'; <StyledFirebaseAuth firebaseAuth={getAuth()} />