I don't know what's wrong with my code
function getItems() {
onSnapshot(collection(db, "todo-items"), (snapshot) => {
setTodoItems(snapshot.docs.map((doc) =>{
return {
id: doc.id,
...doc.data()
}
})
})
}
',' expected.ts(1005)
I get this error and i don't know how to fix it. I tried to fix it.
You missed a closing parenthesis for setTodoItems functions.
function getItems() {
onSnapshot(collection(db, "todo-items"), (snapshot) => {
setTodoItems(
snapshot.docs.map((doc) => {
return {
id: doc.id,
...doc.data()
};
})
); // <- HERE
});
}