Description
openedon Jul 29, 2024
In my React project I'm using RTK-Query with refetchOnFocus
enabled globally.
This is for ensuring fresh data on UI when users keep the app open in the browser all the time, and has been working fine.
The problem I'm encountered with is that this option generates unwanted refetches every time after users interact with components built with the iframe element. While this technically makes sense, I can hardly think of a point in refetches after interacting with the iframe.
I'm hoping focus events via iframes to be excluded from the condition to trigger refetches, but according to my quick survey, it seems it's impossible to tell whether the focus
event comes from an iframe or else.
For my use case, visibilitychange
on the window object is probably closer to the event I'd like to trigger refetches on.
I'd like to know what the maintainers think.