【发布时间】:2018-09-29 18:39:37
【问题描述】:
我试图将此语句添加到我的应用程序以忘记已知警告:
存储在 Firestore 中的 Date 对象的行为将发生变化 并且您的应用程序可能会中断...
我写过:
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 break1
我按照这里的建议做了,但我无法摆脱这个错误......
错误:FirebaseError:未知选项“timestampsInSnapshots”传递给 功能设置()。可用选项:主机、ssl、凭据
【问题讨论】:
标签: react-native google-cloud-firestore