Dapatkan semua data dalam pengumpulan firebase bereaksi

 const [driverBookings, setdriverBookings] = useState([]);
  useEffect(() => {
    db.collection("driverBookings").onSnapshot((snapshot) => {
      let driverBooking = snapshot.docs.map((doc) => ({
        ...doc.data(),
        id: doc.id,
      }));

      setdriverBookings((prev) => [...prev, ...driverBooking]);
    });
Niraj Kafle