We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e80fc49 commit 0e1a7feCopy full SHA for 0e1a7fe
example/withoutSuspense/Firestore.tsx
@@ -10,22 +10,15 @@ import { getFirestore } from 'firebase/firestore';
10
11
const Counter = () => {
12
const firestore = useFirestore();
13
- const app = useFirebaseApp();
14
-
15
- if(getFirestore(app) !== firestore) {
16
- throw new Error('firestore instances do not match')
17
- }
18
19
const ref = doc(firestore, 'count', 'counter');
+ const { status, data: count } = useFirestoreDocData(ref);
20
21
const incrementCounter = (amountToIncrement) => {
22
updateDoc(ref, {
23
value: increment(amountToIncrement),
24
});
25
};
26
27
- const { status, data: count } = useFirestoreDocData(ref);
28
29
if (status === 'loading') {
30
return <LoadingSpinner />;
31
}
0 commit comments