react-firebase-hooks
react-firebase-hooks copied to clipboard
useDocumentData returns undefined on first render until forced browser refresh returns data
Using latest next "next": "13.4.4", reference ticket: https://github.com/CSFrequency/react-firebase-hooks/issues/252
const queryRef = query(
collection(db, "tournaments"),
orderBy("date"),
where("date", ">", timeStamp),
limit(1)
);
const [tournaments, loadingTournaments, errorTournaments] = useCollectionOnce(
queryRef,
{
snapshotListenOptions: { includeMetadataChanges: true },
}
);