refetchOnWindowFocus rerenders
I noticed refetchOnWindowFocus fires many rerenders.
There is a sample here: https://codesandbox.io/s/refetchonwindowfocus-test-xxsf5
Notice it will console.log many times on each windowFocus. Is this the expected behavior?
Initially, I thought it has something to do with the iframe focus (As Codesandbox uses it). But I could reproduce the above issue in the app I'm working on too (No Iframes).
The network call is being made only once, but It re-renders 3 times.
A rerender is triggered for every state change in react query. So mount, fetch start, loading, success, etc. no different than if you were to use useState with useEffect to fetch data.