Ad

Initialize Firebase App In React Js Shows Error

- 1 answer

I'm trying to initialize firebase app in my coreui admin panel react js. I don't know how to initialize it. I have my credentials in firebaseconfigure.js .

And I imported it in login.js .

import 'firebase/auth';
import firebaseConfig from './firebaseConfig'

firebase.auth().signInWithEmailAndPassword(this.state.email, this.state.password).then((user) => {
alert(user);

But It not showing anything. why ?

Ad

Answer

You forgot to initialize thefirebase.initialize().

In your login.js file , add this following line after import.

const firebaseApp = firebase.initializeApp(firebaseConfig);

Now check it again in login page. and let me know .

Ad
source: stackoverflow.com
Ad