Skip to content

Root Component Not Re-rendering #8235

Discussion options

You must be logged in to vote

queryClient.clear(), same as queryClient.removeQueries does not inform currently rendered components. If you want that, you want queryClient.resetQueries. However, I’m not sure what that would achieve: You would logout, and then the root would re-render, in which case the login query runs again, which, idk, fails?

This seems more like an architectural problem. Usually, you’d have different routes for “public” areas (login, signup) and “protected” areas (after login). When the user logs out, I usually just call queryClient.clear() and redirect('/login'), because the login page doesn't use any queries...

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@andelkocvjetkovic
Comment options

Answer selected by andelkocvjetkovic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants