-
I've heard that the query key comparison only happens on render, is there any way to use the query key without using state, and if so, where should I refer to the relevant source code? |
Beta Was this translation helpful? Give feedback.
Answered by
TkDodo
Jan 15, 2024
Replies: 1 comment 5 replies
-
what do you mean "without state" ? The values in the QueryKey are the dependencies to your query, they have to come from somewhere. Usually it's user input or some other dynamic values that are essentially "client state". You have to manage that somehow |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the rules of react still apply. Try to display
params
in a<div>
and you would get the same "not working" state. You can't write to refs and expect them to magically update somewhere. That's what state is for ...