MCPcopy Index your code
hub / github.com/FirebaseExtended/reactfire / Firestore

Function Firestore

example/withoutSuspense/Firestore.tsx:107–135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

105};
106
107export const Firestore = () => {
108 const {status, data: firestoreInstance} = useInitFirestore(async (firebaseApp) => {
109 const db = initializeFirestore(firebaseApp, {});
110 await enableIndexedDbPersistence(db);
111 return db;
112 });
113
114 if (status === 'loading') {
115 return <LoadingSpinner />;
116 }
117
118 return (
119 <>
120 <AuthWrapper fallback={<span>Sign in to use this component</span>}>
121 <FirestoreProvider sdk={firestoreInstance}>
122 <CardSection title="Get/Set document value">
123 <Counter />
124 </CardSection>
125 <CardSection title="Fetch data once">
126 <StaticValue />
127 </CardSection>
128 <CardSection title="Work with lists of data">
129 <AnimalsList />
130 </CardSection>
131 </FirestoreProvider>
132 </AuthWrapper>
133 </>
134 );
135};

Callers

nothing calls this directly

Calls 1

useInitFirestoreFunction · 0.85

Tested by

no test coverage detected