Query is fetching multiple times
I made a simple application to test this.
1. I created a server action with a delay to fetch the current data
2. I have a page "my-data" where I display the data
3. Then I go to "edit-data" where I simply invoke the removeQueries and then go back to "my-data"
4. On "my-data" the query is called 2 times
Why is this happening?
Code:
1 Reply
like-gold•11mo ago
Can it be prefetching by intent because of your router?
I assume you use nextjs?
You could add a staleTime on the query of a second or so and it will probably fix it I assume