Skip to content

react-query-firebase / web/firestore / useDocReferences

Function: useDocReferences()

ts
function useDocReferences<AppModelType>(options): (null | DocumentReference<AppModelType, AppModelType>)[];

Defined in: web/firestore/useDocReferences.ts:32

Gets CollectionReference instances

Type Parameters

AppModelType

AppModelType extends AppModel = AppModel

Parameters

options

Options

references

Omit<{ db: Firestore; path?: string; pathSegments?: string[]; reference?: | CollectionReference<AppModelType, AppModelType> | DocumentReference<AppModelType, AppModelType>; }, "db">[]

Returns

(null | DocumentReference<AppModelType, AppModelType>)[]

A reference to a Firestore document

Example

jsx
export const MyComponent = () => {
 const ref = useDocReference({
     reference: collection('todos')
     path: 'first'
 });
};

Released under the MIT License.