【发布时间】:2019-06-19 03:08:20
【问题描述】:
我想设置带有 react 的 Firebase Auth 预构建 UI 我从github复制了代码 我收到此错误:
TypeError:firebase__WEBPACK_IMPORTED_MODULE_2___default.a.auth 未定义
https://github.com/firebase/firebaseui-web-react
我使用 VScode 和 node.js 安装包
import React from 'react';
import StyledFirebaseAuth from 'react-firebaseui/StyledFirebaseAuth';
import firebase from 'firebase';
uiConfig = {
// Popup signin flow rather than redirect flow.
signInFlow: 'popup',
// We will display Google and Facebook as auth providers.
signInOptions: [
firebase.auth.GoogleAuthProvider.PROVIDER_ID,
firebase.auth.FacebookAuthProvider.PROVIDER_ID
],
callbacks: {
// Avoid redirects after sign-in.
signInSuccessWithAuthResult: () => false
}
};
【问题讨论】:
标签: reactjs firebase firebase-authentication