Describe the bug#
I have a base example of react-query usage. Event without React StrictMode. So, I have a button which toggles a visibility of a block with react-query. Also, I have a lot of logs from React, from API mock and so on. Looks like react-query calls api more than one time.
Your minimal, reproducible example#
https://codesandbox.io/p/sandbox/xr795v
Steps to reproduce#
- Go to the sandbox
- Click to "Toggle fetch data"
- Check the console
Expected behavior#
Just one console.log with text Fetch in progress. It is the log from api mock.
How often does this bug happen?#
Every time
Screenshots or Videos#
Platform#
It doesn't matter
Tanstack Query adapter#
None
TanStack Query version#
v5.90.9
TypeScript version#
v4.4.4
Additional context#
It's just strange, cause I created a quite basic example, which is not working as I expected.
This is what I see in the console of your reproduction. All good.