Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Objects are not valid as a React child (found: object with keys {seconds, nanoseconds}). If you meant to render a collection of children, use an array instead. #37

Open
THEORIGINITE opened this issue Feb 3, 2021 · 0 comments

Comments

@THEORIGINITE
Copy link

THEORIGINITE commented Feb 3, 2021

` const [posts,setPosts] = useState([]);
useEffect(() => {
db.collection("posts").onSnapshot((snapshot)=>
setPosts(snapshot.docs.map((doc)=>({id:doc.id,data:doc.data()})))
);

}, [])`

@THEORIGINITE THEORIGINITE changed the title function Feed() { const [posts,setPosts] = useState([]); 10 | useEffect(() => { > 11 | db.collection("posts").onSnapshot((snapshot)=> 12 | setPosts(snapshot.docs.map((doc)=>({id:doc.id,data:doc.data()}))) 13 | ); Error: Objects are not valid as a React child (found: object with keys {seconds, nanoseconds}). If you meant to render a collection of children, use an array instead. Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant