Authenticated routes with tanstack Query requires window reload
I implemented a authenticated routes with Tanstack router. Information about user coming from Tanstack Query. Like this:
in RootRoute:
So on login or logout, this code in authenticated component isn't triggered, even on queryClient.refetchQueries({ queryKey: ["user-profile"] }); only window.location.reload() works. But it's a SPA and reloading flickering isn't great looking. How do I make the code from authenticated work without page reload ? What I've missed ?
0 Replies