Preventing Multiple API Calls in useInfiniteQuery on Favorite Selection useMutation function #8607
Unanswered
DarshitChauhan
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello @TkDodo
I am using useInfiniteQuery to implement the "Load More" and "Load Less" functionality for rendering data. I have loaded a total of five pages.
Currently, when I select an item as a favorite from the first page (inside a child component), the useInfiniteQuery is triggered five times due to the mutation function. The same issue occurs when I remove the item from favorites.
I would appreciate your suggestions on how to prevent multiple unnecessary API calls while ensuring the data remains updated efficiently.
Thank You.
Beta Was this translation helpful? Give feedback.
All reactions