'Reactfire: useFirestore().collection is not a functon

I am having a bit of a fight with reactfire and its poor documentation.

I see many examples around using the apis coming from useFirestore() as if that was a normal firestore instance coming from the firebase SDK.

I see code like:

const firestore = useFirestore()

const myCollection = firestore.collection('collectionName')

But if I try to do that I get firestore.collection is not a function. Did something radically change recently or am I not getting something?

Thanks in advance for any help!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source