I have an object in my react code as below.
const [inputs, setInputs] = useState({
groupName: '',
groupDescription: '',
priv: []
});
After setInputs to above state, I execute the below function.
const addDataToFb = () => {
console.log(inputs)
firebase.firestore().collection('userGroups').add(inputs)
.then(() => {
alert('Group successfully created')
resetButtonHandler();
})
.catch((err) => {
alert(err)
})
}
The console has logged below details. Refer this image.