QueryClient cache getting invalidated between navigation?
currentUser state is managed in an isomorphic QueryClient, but it seems to return inconsistent behavior throughout the app. when i am logged in:* visiting
/chat correctly loads the active user from state* visiting
/chat, then visiting /, then reloading, then visiting /chat shows i am logged out! a simple refresh corrects the state.i think my setup is pretty straight forward, so not sure where my misstep is:
i've got a root (
__root.tsx) route defined as:userQueryOptions looks like this:and i consume it with a basic hook:
my understanding is that the result of
useUser should always be fresh between navigations as we call ensureQueryData. is this not correct?