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

Enabled option error #90

Open
rasul-surname opened this issue May 4, 2023 · 1 comment
Open

Enabled option error #90

rasul-surname opened this issue May 4, 2023 · 1 comment

Comments

@rasul-surname
Copy link

rasul-surname commented May 4, 2023

Please help me with a problem

Description of the problem:

Everything works fine until I refresh the browser page.
I expect the request to be executed after the userId is true
But subscribe seems to ignore the enabled option

That is, the userId does not have time to form, as it makes a request?

What am I doing wrong?

Writing user.uid to the global state
image

Getting a collection by userId from the global state
image

@danielMensah
Copy link

I think you need to add the constraint to request's queryKey e.g.

return useFirestoreQuery([userId, { userId }].....

Docs

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

2 participants