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

useEffect loop #4

Open
mcbba opened this issue Jul 18, 2022 · 0 comments
Open

useEffect loop #4

mcbba opened this issue Jul 18, 2022 · 0 comments

Comments

@mcbba
Copy link

mcbba commented Jul 18, 2022

Line 13 of app.jsx:

useEffect(() => {
getDoc(user).then((doc) => {
setTODO(doc.data().todos);
});
}, [user]);

This causes an infinite loop of requests to the firestore database, racking up about 50,000 requests an hour. Is there a good method for allowing useEffect to render setTODO without this error?

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