react-query-firebase / react-native/firestore / useDocReferences
Function: useDocReferences()
ts
function useDocReferences<AppModelType>(options): (null | DocumentReference<AppModelType>)[];
Defined in: react-native/firestore/useDocReferences.ts:32
Gets CollectionReference
instances
Type Parameters
AppModelType
AppModelType
extends AppModel
= AppModel
Parameters
options
Options
references
Omit
<{ db
: Module
; path?
: string
; pathSegments?
: string
[]; reference?
: | CollectionReference
<AppModelType
> | DocumentReference
<AppModelType
>; }, "db"
>[]
Returns
(null
| DocumentReference
<AppModelType
>)[]
A reference to a Firestore document
Example
jsx
export const MyComponent = () => {
const ref = useDocReference({
reference: collection('todos')
path: 'first'
});
};