{ console.log(typeof(basketArray)) addDoc(orderCollectionRef, { name: newName, ema" /> { console.log(typeof(basketArray)) addDoc(orderCollectionRef, { name: newName, ema" /> { console.log(typeof(basketArray)) addDoc(orderCollectionRef, { name: newName, ema"/>

Function addDoc() called with invalid data. Unsupported field value: undefined, when an object is passed. React Js

28 Views Asked by At

I want to send an "object" in firestore.

const handleSubmit = () => {
  console.log(typeof(basketArray))
  addDoc(orderCollectionRef, {
    name: newName,
    email: newEmail,
    phone: newPhone,
    home: newHome,
    pinCode: newPinCode,
    city: newCity,
    state: newState,
    numberOfBooks: (basket.length),
    order: basket,
  }).then(makePayment)
}

The basket is an object.

I tried using Object.value(basket) Object.entries(basket) Object.key(basket) none of these worked.

0

There are 0 best solutions below