redux-toolkit
redux-toolkit copied to clipboard
refetchOnFocus and isLoading / isFetching
I have a client side react app, navigation is done using react router v 6.
In the root component (always mounted), I have a hook query with the flag refetchOnFocus = true
const { isLoading } = useMyQuery(undefined, { refetchOnFocus: true })
if (isLoading) return <Spinner />
the problem is that each time I focus the tab, isLoading is always true, is this the correct behavior?? I thought that isLoading only fires on first mount and then isFetching runs each time I focus the tab??
It should... Can you create a reproduction or replay of this?