我在反應應用程式中安裝了 firebase 并像這樣初始化
// Import the functions you need from the SDKs you need
import { initializeApp } from "firebase/app";
import { getAuth, GoogleAuthProvider } from "firebase/auth"
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
// Your web app's Firebase configuration
const firebaseConfig = {....};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
// export
export const auth = getAuth(app);
export const googleAuthProvider = new GoogleAuthProvider();
并像這樣將此檔案匯入到我的反應組件中
import {auth} from '../../firebase';
我試著像這樣使用它
await auth.sendSignInLinkToEmail(email, config);
它給了我這個錯誤

uj5u.com熱心網友回復:
在 Firebase v9 中,您需要使用模塊化sendSignInLinkToEmail():
import { auth } from '../../firebase';
import { sendSignInLinkToEmail } from "firebase/auth"
await sendSignInLinkToEmail(auth, email, config);
您可以通過熟悉命名空間 SDK 到模塊化 SDK 升級程序來自己捕獲這些錯誤。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/373320.html
標籤:javascript 反应 火力基地
上一篇:如何為視頻添加動態字幕?
下一篇:遞回搜索回傳未定義
