I'm sorry I tried googling it, tried reading the documents which came up with and other stackoverflow posts which mentioned using 'DocumentSnapshot' or firestore.documentdata. but it didn't work.

I tried object too. Only any works unfortunately.

Here are my imports

import logo from './logo.svg';
import './App.css';

import 'firebase/firestore';
import { useFirestoreDocData, useFirestore } from 'reactfire';
import { FireObject } from '@testing-library/dom';

And Here's the Code

function Burrito() 
  const burritoRef = useFirestore()
    .collection('tryreactfire')
    .doc('burrito');

  const { status, data }: { status: any; data: any }  =         
  useFirestoreDocData(burritoRef);

  if (status === 'loading') {
    return <p>Fetching burrito flavor...</p>;
  }

  return <p>The burrito is {data.yummy ? 'good' : 'bad'}!</p>;
}
0

There are 0 best solutions below