CSFrequency / react-firebase-hooks

React Hooks for Firebase.
Apache License 2.0
3.6k stars 306 forks source link

TypeError: v1.isEqual is not a function #177

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hey, I am using the useCollectionData hook in NextJs/React project. I am fetching some posts from my firestore database and I am getting this error TypeError: v1.isEqual is not a function

This is the code that I am using to fetch the posts.

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

Can anyone help me fix this bug?

bhuisgen commented 3 years ago

Same problem here. Reverting to a React side effect + firestore API onSnapshot.

ghost commented 3 years ago

The problem is with useCollectionData, it is not compatible with v9 sdk.

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