【问题标题】:TypeError: v1.isEqual is not a functionTypeError:v1.isEqual 不是函数
【发布时间】:2021-12-10 00:59:23
【问题描述】:

我在 NextJs/React 项目中使用 useCollectionData 钩子。我正在从我的 firestore 数据库中获取一些帖子,并且收到此错误 TypeError: v1.isEqual is not a function

这是我用来获取帖子的代码。

const [posts]: [Post[] | undefined, boolean, Error | undefined] =
useCollectionData<Post>(renderPosts, { idField: "id" });

【问题讨论】:

  • 错误不在这部分
  • @ABDULLOKHMUKHAMMADJONOV 是正确的。请提供v1.isEqual函数所在的完整代码。
  • 该函数来自我正在使用的一个名为react-fireabase-hooks的包

标签: typescript firebase google-cloud-firestore next.js


【解决方案1】:

问题出在useCollectionData,与v9 sdk不兼容。

const posts: any = await getDocs(collection(db, "posts"))

【讨论】:

    猜你喜欢
    • 2010-11-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多