Open nucleartux opened 3 weeks ago
I cannot reproduce this, maybe I am too slow :D can you please create a video?
https://drive.google.com/file/d/1XcXgCSMdGj4KtGS0SAVlp86ZdDQSosIj/view?usp=sharing
(I was unable to upload the video to GitHub due to size restrictions. Sorry.)
You can fast forward the parts of the video where I wait for pages to load, by the way.
is there any way this can be made easier reproducible? do those timeouts affect the behavior ?
Actually, reproduction is much easier than it seemed.
https://github.com/TanStack/router/assets/199706/c3fbb3ef-3be5-4f34-ac2c-f239a64a0d89
If I set defaultPreload
to false, everything works as expected.
I've encountered this same behaviour. In my testing, It seems like the beforeLoad just doesn't run after the actual click if it has been preloaded from a hover and you haven't unhovered and then rehovered.
I think when you unhover and then hover again, because it's already preloaded, the hover doesn't trigger the beforeLoad again and therefore clicking works, but if the hover did trigger the preload and you click it without leaving the hover state, it never runs.
I'll likely be investigating this issue further next week so I'll update this post if I find any further information about what causes the issue.
this will be fixed by #1907
reproducer with pre-release package: https://stackblitz.com/edit/tanstack-router-v9onbn?file=src%2Froutes%2F_auth.tsx
Describe the bug
I expect that every every time I enter the route beforeLoad will be called
Your Example Website or App
https://stackblitz.com/edit/tanstack-router-94bxv9?file=src%2Froutes%2F_auth.tsx
Steps to Reproduce the Bug or Issue
(You may need a few tries.)
Expected behavior
On Step 4, loading happens again, and I'm redirected to the login page.
Screenshots or Videos
No response
Platform
Additional context
If it's expected behavior, how can I avoid it?