Skip to content

Commit 0e1a7fe

Browse files
committed
clean up firestore example
1 parent e80fc49 commit 0e1a7fe

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

example/withoutSuspense/Firestore.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,15 @@ import { getFirestore } from 'firebase/firestore';
1010

1111
const Counter = () => {
1212
const firestore = useFirestore();
13-
const app = useFirebaseApp();
14-
15-
if(getFirestore(app) !== firestore) {
16-
throw new Error('firestore instances do not match')
17-
}
18-
1913
const ref = doc(firestore, 'count', 'counter');
14+
const { status, data: count } = useFirestoreDocData(ref);
2015

2116
const incrementCounter = (amountToIncrement) => {
2217
updateDoc(ref, {
2318
value: increment(amountToIncrement),
2419
});
2520
};
2621

27-
const { status, data: count } = useFirestoreDocData(ref);
28-
2922
if (status === 'loading') {
3023
return <LoadingSpinner />;
3124
}

0 commit comments

Comments
 (0)