-
-
Notifications
You must be signed in to change notification settings - Fork 497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Context not getting updated in beforeload of router #1604
Comments
could you please provide this as a complete example on stackblitz (e.g. by forking one of the existing examples)? |
https://stackblitz.com/~/github.com/PR4SAN/tanstack-router i have tried to make a version of my project removing all the details. let me know if additional details needed. This one from documentation where i modified some routes and some implementation to have data fetched as async and this works fine. if i am logged in and i navigate to login it redirects me to dashboard and and vice versa. |
which steps are required to reproduce? please also update to the latest |
I think we ran into the same bug, I made a repo that reproduces it: |
I have checked with updating the version didn't fix the issue in my project. i have updated it in stackblitz example as well. |
yes this is the same issue I am facing as well. |
@tannerlinsley just released v1.32.16 30 minutes ago and fixes #1618 issue. Please check if this issue is resolved |
@PR4SAN The issue you are facing is because your router context is not being updated after the useQuery has finished its fetch. You can either:
You may also want to check out the authenticated routes example, where their concepts are put to use. Just remember, that you need to take the concepts and adapt it to work with your auth flow. Auth is not static, with every project implementing it just a little bit different from the next. |
Thanks. Invalidating the router and updating it to the latest version fixed my issue. Also, I noticed the example in the doc is updated. Thanks |
Describe the bug
Followed the same example of the protected route from the documentation.
Your Example Website or App
na
Steps to Reproduce the Bug or Issue
followed the same protected route example from doc but the context value for router is not getting updated
Expected behavior
context value should get updated.
Screenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: