You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only the protected routes are wrapped by the QueryClientProvider
I have a dialog component that is present on every page and that contains a logout button
The logout button is conditionally displayed, only on protected routes
In this context, I can't use useMutation and useQueryClient to remove queries as the dialog component is also rendered outside of the QueryClientProvider and I can't conditionally import them (rule-of-hooks).
Now, I really don't want to create two different dialog components for protected and non-protected routes respectively, so is it bad if queries aren't removed when logging out? I haven't witnessed any UX problem for now.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Here's the situation:
In this context, I can't use useMutation and useQueryClient to remove queries as the dialog component is also rendered outside of the QueryClientProvider and I can't conditionally import them (rule-of-hooks).
Now, I really don't want to create two different dialog components for protected and non-protected routes respectively, so is it bad if queries aren't removed when logging out? I haven't witnessed any UX problem for now.
Beta Was this translation helpful? Give feedback.
All reactions