I'm trying to make simple crud application but I'm getting this error while updating doc:
[Unhandled promise rejection: TypeError: t is not an Object. (evaluating '"_delegate" in t')]
Here is following code what I do:
//update user
const updateUser = async (id, age) => {
const newFields = {age: age + 1};
const userDoc = doc(usersRef, id)
await updateDoc(id, newFields).then(console.log('updated succesfully'))
};
//jsx
{users.map((user) => {
return (
<View key={user.name} style={{ width: "30%", marginLeft: "35%", marginBottom: 20 }}>
<Text>name: {user.name}</Text>
<Text>age: {user.age}</Text>
<Button
onPress={() => updateUser(user.id, user.age)}
title="increase age"
/>
</View>
);
})}
thanks.