You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As `useCollection`, but this hook extracts a typed list of the `firestore.QuerySnapshot.docs` values, rather than the
@@ -133,11 +134,13 @@ Returns:
133
134
-`values`: an array of `T`, or `undefined` if no query is supplied
134
135
-`loading`: a `boolean` to indicate if the data is still being loaded
135
136
-`error`: Any `firestore.FirestoreError` returned by Firebase when trying to load the data, or `undefined` if there is no error
137
+
-`snapshot`: a `firestore.QuerySnapshot`, or `undefined` if no query is supplied. This allows access to the underlying snapshot if needed for any reason, e.g. to view the snapshot metadata
As `useCollectionData`, but this hook will only read the current value of the `firestore.Query`.
@@ -155,6 +158,7 @@ Returns:
155
158
-`values`: an array of `T`, or `undefined` if no query is supplied
156
159
-`loading`: a `boolean` to indicate if the data is still being loaded
157
160
-`error`: Any `firestore.FirestoreError` returned by Firebase when trying to load the data, or `undefined` if there is no error
161
+
-`snapshot`: a `firestore.QuerySnapshot`, or `undefined` if no query is supplied. This allows access to the underlying snapshot if needed for any reason, e.g. to view the snapshot metadata
As `useDocument`, but this hook extracts the typed contents of `firestore.DocumentSnapshot.data()`, rather than the
@@ -243,11 +248,13 @@ Returns:
243
248
-`value`: `T`, or `undefined` if no query is supplied
244
249
-`loading`: a `boolean` to indicate if the data is still being loaded
245
250
-`error`: Any `firestore.FirestoreError` returned by Firebase when trying to load the data, or `undefined` if there is no error
251
+
-`snapshot`: a `firestore.DocumentSnapshot`, or `undefined` if no query is supplied. This allows access to the underlying snapshot if needed for any reason, e.g. to view the snapshot metadata
As `useDocument`, but this hook will only read the current value of the `firestore.DocumentReference`.
@@ -265,6 +272,7 @@ Returns:
265
272
-`value`: `T`, or `undefined` if no query is supplied
266
273
-`loading`: a `boolean` to indicate if the data is still being loaded
267
274
-`error`: Any `firestore.FirestoreError` returned by Firebase when trying to load the data, or `undefined` if there is no error
275
+
-`snapshot`: a `firestore.DocumentSnapshot`, or `undefined` if no query is supplied. This allows access to the underlying snapshot if needed for any reason, e.g. to view the snapshot metadata
0 commit comments