useCollection not working
kingsleykbc opened this issue · comments
Anyabuike Kingsley commented
Trying to use useCollection
in the code below:
import React from 'react';
import { app } from '../firebase/clientApp';
import { collection, getFirestore } from 'firebase/firestore';
import { useCollection } from 'react-firebase-hooks/firestore';
const Home = props => {
const [blogs, loading, error] = useCollection(
collection(getFirestore(app), 'blogs'), {
snapshotListenOptions: { includeMetadataChanges: true }
});
console.log(blogs);
return (
<Section>
<pre>{JSON.stringify(blogs, null, 2)}</pre>
...
But I keep getting this error message:
index.esm.js?352f:101 Uncaught TypeError: v1.isEqual is not a function
at isEqual (index.esm.js?352f:101)
at eval (index.esm.js?352f:90)
at invokePassiveEffectCreate (react-dom.development.js?ac89:23487)
at HTMLUnknownElement.callCallback (react-dom.development.js?ac89:3945)
at Object.invokeGuardedCallbackDev (react-dom.development.js?ac89:3994)
at invokeGuardedCallback (react-dom.development.js?ac89:4056)
at flushPassiveEffectsImpl (react-dom.development.js?ac89:23574)
at unstable_runWithPriority (scheduler.development.js?bcd2:468)
at runWithPriority$1 (react-dom.development.js?ac89:11276)
Chris Bianca commented
@kingsleykbc which version of react-firebase-hooks
do you have installed? My guess is that you might have version 3.0.x rather than v4
Anyabuike Kingsley commented
Yes, my bad. I am on version 3.0.5.
I'll update and try again
Chris Bianca commented
No problem, I'm going to close this issue