Router Context not updating
basically the same problem as here: https://stackoverflow.com/questions/77856598/tanstack-router-how-to-pass-value-from-another-context
Setup is a little different because I am using react-query to get the currently logged in user.
Even when the query dev tools tell me that
Setup is a little different because I am using react-query to get the currently logged in user.
Even when the query dev tools tell me that
currentUserQuery.data has updated, the context still keeps the old values. This means I manually need to add useEffect in the protected routes and redirect users if they are not logged in, since I cannot rely on the context. What am I missing?Stack Overflow
I'm building a react app that is using Tanstack router, and I'd like to access values from a context provider that I created over to the router beforeLoad handler for a given route. My app structure