-
-
Notifications
You must be signed in to change notification settings - Fork 444
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
Passing context w/o memo to useQuery triggers infinite loop #805
Comments
This has been discussed recently, this is because we shouldn't really be deciding for you whether or not your Some related:
We also have a Spectrum that might be better suited for usage questions. |
Thanks for quick explanation. It is fair point that you don't want to decide if it should or should not trigger the re-render. Not really because of functions as they are not even shallow or deep equal but but I get you. I still think shallow equal would be better as it is how components work in react and avoids most the problems you are mentioning. Would be great to at least document current behaviour as I'm not the first one asking and it is bit unexpected. |
As mentioned in here passing context object to useQuery triggers infinite request/cancel/request/.. loop.
Passing context like this to triggers infinite request loop
and changing it to this one fixes that.
From the behaviour I assume that somewhere in code the context object is referentialy compared and I would expect either shallow (to match react behaviour) or deep comparison (easier to understand for most devs) of it.
The text was updated successfully, but these errors were encountered: