-
I am encountering an error when attempting to use v9 as follows - perhaps I am not doing something properly, but the error message is rather cryptic. onSnapshot(
collection(firestore, colRef),
(snap) => {
if (snap.empty) {
setStatus('fetched');
return;
}
const documents = snap.docs.map((doc) => ({
id: doc.id,
...doc.data() // error: Spread types may only be created from object types
}));
setData(documents);
setStatus('fetched');
},
(error) => {
setData([error]);
setStatus('error');
}
); |
Beta Was this translation helpful? Give feedback.
Answered by
samtstern
Apr 21, 2021
Replies: 2 comments 5 replies
-
This looks like a typescript error for me. Is there a chance that your |
Beta Was this translation helpful? Give feedback.
4 replies
-
@puchesjr I am able to reproduce this and since it's a bug I am going to move it to an issue. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
samtstern
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@puchesjr I am able to reproduce this and since it's a bug I am going to move it to an issue.