gpt4 book ai didi

react-native - 无法设置 firestore().settings({ timestampsInSnapshots : true }) in App

转载 作者:行者123 更新时间:2023-12-03 09:28:57 25 4
gpt4 key购买 nike

我试图将此语句添加到我的应用程序以忘记已知警告:

The behavior for Date objects stored in Firestore is going to change AND YOUR APP MAY BREAK...



我写过:
import * as firebase from 'firebase';
import '@firebase/firestore';

export default class App extends React.Component {
componentWillMount() {
const config = {
apiKey: '...',
authDomain: '...',
databaseURL: '...',
projectId: '...',
storageBucket: '...',
messagingSenderId: '...'
};

firebase.initializeApp(config);

const settings = { timestampsInSnapshots: true };

firebase.firestore().settings(settings);
}

这是许多人建议的方式,例如这个答案:

Firebase update error: The behavior for date objects stored in Firestore is going to change and your app may break 1

我做了这里建议的事情,但我无法摆脱这个错误......

Error: FirebaseError: Unknown option 'timestampsInSnapshots' passed to function settings(). Available options: host, ssl, credentials

最佳答案

在最新的 Firestore 的最新版本中,例如版本 (7.14.0):不再需要设置“timestampsInSnapshots: true”,应将其删除。

关于react-native - 无法设置 firestore().settings({ timestampsInSnapshots : true }) in App,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52571416/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com