[英]Initialize firebase app in react js shows error
I'm trying to initialize firebase app in my coreui admin panel react js.我正在尝试在我的 coreui 管理面板 react js 中初始化 firebase 应用程序。 I don't know how to initialize it.
我不知道如何初始化它。 I have my credentials in
firebaseconfigure.js
.我在
firebaseconfigure.js
中有我的凭据。
And I imported it in login.js.我将它导入到 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?
为什么?
You forgot to initialize the firebase.initialize()
.您忘记初始化
firebase.initialize()
。
In your login.js
file, add this following line after import
.在您的
login.js
文件中,在import
之后添加以下行。
const firebaseApp = firebase.initializeApp(firebaseConfig);
Now check it again in login page.现在在登录页面再次检查。 and let me know.
让我知道。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.