-
Beta Was this translation helpful? Give feedback.
Answered by
TkDodo
Jun 6, 2021
Replies: 1 comment 2 replies
-
|
react-query will not refetch on every re-render, that would be waaay too much. It will refetch if the key changes, so please put all your "dependencies" for the queryFn into the query key. Your queryFn uses |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
mickael-h
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


react-query will not refetch on every re-render, that would be waaay too much. It will refetch if the key changes, so please put all your "dependencies" for the queryFn into the query key. Your queryFn uses
user.uuid, so if you want react-query to refetch whenever the id changes, you have to make it part of the queryKey: