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
Router does not trigger loader
or beforeLoad
when navigating to same url
#1324
Comments
please provide a minimal complete example, e.g. by forking one of the existing examples on stackblitz aside from that, https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#key-options |
I investigated my situtation even further and I think that previously I agree that giving a minimal working example would be beneficial in any situtation when trying to resolve bugs. Unfortunately, I am quite busy right now as we have already spent a whole work week trying to upgrade the router library. 😆 I hope the API is going to stay more stable now that you have passed the version 1.x milestone. |
load
or beforeLoad
when navigating to same urlloader
or beforeLoad
when navigating to same url
I was able to reproduce this. Reproducer:
working in 1.18.3: https://stackblitz.com/edit/tanstack-router-acssx4?file=src%2Froutes%2Fsearch.tsx |
Great to hear you were able to reproduce the bug! Hopefully we will get a fix for it. :) |
any known workarounds ? or an update for a fix? |
@mta-trackunit
Also, not even sure how to access |
Retesting this with the 1.32.12 release, the console logs get logged out on every click. Retest: https://stackblitz.com/edit/tanstack-router-mvbt6c?file=src%2Froutes%2Fsearch.tsx Is this still an issue? |
@SeanCassiere No, the issue that I have is that I have some tabs that update the URL with a search parameter to persist the view but it seems like some exception is thrown or there is a race condition when beforeLoad runs executing my async validation function. It causes a white screen which requires a manual refresh to see the page. The only way I got around it was by force navigating but I thought I wouldn't have to do that. |
@rajbirjohar will need a reproduction for this. |
Describe the bug
Hi
I have a search form view which contains some search options as html inputs and a search button. It works like this:
I press "Search" button, which does nothing but programmatically navigates to the current path + also incudes some query params. This causes the
load
andbeforeLoad
functions of the current route to trigger, looking for the updated search parameters and performing the search.If I now press the "Search" button again, without making any changes to the search parameters, it programmatically navigates to the current url again. This time,
load
andbeforeLoad
functions are not executed. It seems that these functions are not executed if the url of the page has not changed.There should be away to make these function trigger even if the navigation occurs to the same url. Otherwise, I cannot perform the same search again.
I tried including
shouldReload: true
option for the route, but it did not help.This worked well in
0.0.1-beta.185
but not in1.19.4
The text was updated successfully, but these errors were encountered: