我在 React 应用程序中收到以下错误消息:
@firebase/firestore: Firestore (4.13.0): The behavior for Date objects stored in Firestore is going to change AND YOUR APP MAY BREAK.
有人在 react 应用程序中看到过这个问题并修复了它吗?您能分享您的见解/代码吗?
我看到角度应用程序提到了同样的问题: https://github.com/firebase/firebase-js-sdk/issues/726
对于 react native 应用程序(建议不要对这个问题做任何事情): https://github.com/invertase/react-native-firebase/issues/1024
最佳答案
firebase.initializeApp({
apiKey: "***********************",
authDomain: "***********************",
databaseURL: "***********************",
projectId: "***********************",
storageBucket: "***********************",
messagingSenderId: "***********************"
});
const settings = {timestampsInSnapshots: true};
firebase.firestore().settings(settings);
只需在您要配置 firebase/firestore 代码的代码中添加上述两条语句即可。
关于reactjs - 在 React 中(不是 native react ): The behavior for Date objects stored in Firestore is going to change AND YOUR APP MAY BREAK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50585539/