Cloud Firestore
The @react-query-firebase/firestore
package provides hooks querying,
subscribing and modifying collections and documents on Cloud Firestore.
Usage
To use the hooks, export your Firestore
instance, e.g:
import { initializeApp } from 'firebase/app';
import { getFirestore } from 'firebase/firestore';
const firebase = initializeApp({
...
});
export const firestore = getFirestore(firebase);
Important:
When providing Query and Document Reference instances to the hooks, it is important to remember the hooks will only refetch the data when the Query Key changes and not the instance. If your data is shared across your application, ensure you provide a unique key for each instance type.