react-query-firebase icon indicating copy to clipboard operation
react-query-firebase copied to clipboard

Enabled option error

Open rasul-surname opened this issue 2 years ago • 1 comments

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

rasul-surname avatar May 04 '23 15:05 rasul-surname

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

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

Docs

danielMensah avatar Jun 02 '23 20:06 danielMensah