reactjs - 在 React(不是本机反应)中:存储在 Firestore 中的 Date 对象的行为将发生变化,您的应用程序可能会中断
问题描述
我在反应应用程序中收到以下错误消息:
@firebase/firestore:Firestore (4.13.0):存储在 Firestore 中的 Date 对象的行为将发生变化,您的应用程序可能会中断。
有人在反应应用程序中看到这个并修复它吗?你能分享你的见解/代码吗?
我看到了对Angular 应用程序的相同问题的引用: https ://github.com/firebase/firebase-js-sdk/issues/726
对于反应原生应用程序(建议不要对这个问题做任何事情): 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 代码的代码中添加上述两个语句。
推荐阅读
- r - 在R中舍入dbl值?
- arrays - 从结构数组中传递一个元素并在 C 中连接一个字符串
- arrays - 卡在一个 Java 问题上 - 如何从列表中创建一个数组并对其进行总结?
- javascript - javascript过滤方法中的不同功能
- ruby-on-rails - Rails:排队电子邮件,直到用户让它发送
- javascript - 如何将数组中的所有表情放入嵌入中?- 不和谐.js
- ios - 使用操作来管理函数调用之间的不平衡
- apache - 是否可以重定向子域通配符
- javascript - 在单独的 AJAX 函数/API 调用中使用现有的 lat/lng 传单标记
- tornadofx - 有没有办法打印 TornadoFX 样式表?