我无法导入getReactNativePersistence
模块从firebase/auth
。我正在使用打字稿。
可以导入下面的函数,但是当我从以下位置更新 Firebase SDK 时它不起作用9.22.0
to 10.1.0
.
import { getReactNativePersistence } from "firebase/auth/react-native";
这好像是没有firebase/auth/react-native
不再了。
我还尝试了以下代码,如该文件 https://firebase.google.com/docs/reference/js/auth表明,
import { getReactNativePersistence } from "firebase/auth";
但它会引发错误。
Module '"firebase/auth"' has no exported member 'getReactNativePersistence'.
我使用的是 Expo,它默认使用 Metro。
这是我的metro.config.js
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require('expo/metro-config');
module.exports = getDefaultConfig(__dirname);
我怎样才能导入getReactNativePersistence
in [email protected] /cdn-cgi/l/email-protection
?
{
"compilerOptions": {
"paths": {
"@firebase/auth": ["./node_modules/@firebase/auth/dist/index.rn.d.ts"]
}
},
"extends": "expo/tsconfig.base"
}
显然,这是一个打字稿问题。将上面的代码添加到您的 tsconfig.json 文件中。这个修复对我有用。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)