我在用react-i18next
。有时 init 函数组件面临 React 问题。知道是什么原因造成的吗?
我的配置
import i18n from "i18next";
import resources from "./locales";
import { initReactI18next } from "react-i18next";
const options = {
debug: false,
lng: "en",
resources: resources,
fallbacking: "en",
};
i18n.use(initReactI18next).init(options);
export default i18n;
Run Code Online (Sandbox Code Playgroud)
我的版本
"react": "^16.13.1",
"react-i18next": "^11.7.2",
Run Code Online (Sandbox Code Playgroud) 我从我的 Firestore 数据库中获取了简单的数据,但我想用一些排序和 where 条件对其进行分页。所以我试图用一些基本的过滤器来获取数据,但面临错误,在文档https://firebase.google.com/docs/firestore/query-data/order-limit-data 中描述的仅适用于范围 <, <= , >, >= 应该使用 orderBy 和 where 用于相同的字段,但我只需要完全匹配 (==)
node v8.12.0,express,firebase 函数
model.collection
.orderBy("dateCreated", 'desc')//timeStamp
.where('tenantId', '==', 'f8XnOVUKob5jZ29oM9u9')
.limit(10)
.get()
.then((snapshot) => {
res.send(snapshot);
}).catch((error) => res.send(error));
Run Code Online (Sandbox Code Playgroud)
遇到下一个错误
{
"code": "failed-precondition",
"name": "FirebaseError"
}
Run Code Online (Sandbox Code Playgroud)
我只有在单独使用 where 或 orderBy 时才有结果,但不是同时使用