score:0

    let bookingsArr = providers.reduce((wholeArray, item)=> ([
        ...wholeArray,
        ...item.bookings.map((booking) => ({
            "title": item.title, 
            "seeker": booking.seekerId, 
            "status": booking.status, 
            "imageUrl": item.imageUrl
        }))
    ]), [])

score:1

function loadBookings() {
    const [bookingsArr, setbookingsArr] = useState([]);

  useEffect(() => {
      firebase.database().ref('Clothvalues').once('value').then((providers)=>{
        if (!providers.val()) {
            return undefined;
        }else{
            providers.map((item,key)=>{
                item.bookings.map((booking,key)=>{
                    setbookingsArr(bookingArr => [...bookingArr, {"title":item.title,"seeker":booking.seekerId,"status":booking.status,"imageUrl":item.imageUrl}]);
                })
            })
        }
      })
  });

  return bookingsArr;
}

Related Query

More Query from same tag