Skip to content

react-query-firebase / firestore / useDocReference

Function: useDocReference()

ts
function useDocReference<AppModelType, DbModelType>(options): null | DocumentReference<AppModelType, DbModelType>

Defined in: src/firestore/useDocReference.ts:53

Custom hook to generate and manage a Firestore document reference. This hook facilitates the retrieval of a Firestore document reference based on given options such as path and reference data. The reference is updated whenever the associated path, reference, or path segments change.

Type Parameters

AppModelType

DbModelType extends DocumentData = DocumentData

Parameters

options

UseDocReferenceOptions<AppModelType, DbModelType>

Configuration options for setting up the document reference.

Returns

null | DocumentReference<AppModelType, DbModelType>

The Firestore document reference corresponding to the provided path and options, or null if not initialized.

Released under the MIT License.