react-firebase-hooks icon indicating copy to clipboard operation
react-firebase-hooks copied to clipboard

useDocumentData returns undefined on first render until forced browser refresh returns data

Open 0xkvai opened this issue 2 years ago • 0 comments

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 },
    }
  );

0xkvai avatar Jun 14 '23 01:06 0xkvai