Home > Blockchain >  Chnges with regard to firebase v9
Chnges with regard to firebase v9

Time:11-21

My friend wrote this code last year, Now that firebase v9 has some syntax changes, its not working anymore. What changes should i make -

useEffect(() => {
    const colRef = collection(db, 'movies',doc(id)) 
    colRef.doc(id)
    .get()
    .then((doc) => {
        if (doc.exists) {
            setDetailData(doc.data());
        } else {
            console.log("No such document in firebase            
  • Related