Infinite Fetching Issue with useQueries on Param Changes #8503
Unanswered
dimmasyusuf
asked this question in
Q&A
Replies: 1 comment
-
seems fine, except that the useEffect is totally unnecessary. Why would you copy the params to state instead of depending on the params directly? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello React Query community,
I’ve been encountering an issue with useQueries in my project. Every time the params object changes, the queries (usersByRoleQueries) start fetching indefinitely. Below is the relevant code snippet:
The usersByRoleQueries are created dynamically using the roleIds and the params object, which updates whenever search parameters change. However, this seems to cause an infinite fetching loop.
What I’ve tried so far:
Questions:
I’d appreciate any guidance or suggestions. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions