Obtenga todos los datos en la recopilación Firebase React
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