-
-
Notifications
You must be signed in to change notification settings - Fork 720
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
beforeLoad
adds ~400ms delay on page reload
#2183
Comments
beforeLoad
adds ~400ms delay on page rloadbeforeLoad
adds ~400ms delay on page reload
As a temporary fix, add |
I just saw this issue and added the temporary fix and my app feels way faster now... This needs a fix. |
Also noticed that adding this makes the app a lot more snappy, especially since we perform a lot of middleware/guard checks in Can be disabled for the entire router by setting |
Same here, I wasted soo much time digging in this and in the end it was the devtools, after removing them and setting the |
The presence of Even if we have To goal of this setting is to ensure that loads don’t flash - if we need to see them, we should see them “for a bit”. Because loader or beforeLoad are defined, we determine that we should see the If you only have a
for that route. Mostly, I think the defaults are fine because loaders will be used to load data, which can take a couple hundreds of milliseconds, so we’d want to really avoid flashing in the loader (which even happens with @schiller-manuel FYI |
Describe the bug
When adding
beforeLoad
to a route (even an empty one), the router gets mounted and then displays a white page for approx. 400ms before the actual page is rendered.Your Example Website or App
https://stackblitz.com/github/tanstack/router/tree/main/examples/react/quickstart-file-based
Steps to Reproduce the Bug or Issue
beforeLoad: () => {}
to any page - I chose the about page.Expected behavior
Simply adding the
beforeLoad
option should not materially change load times.Screenshots or Videos
router.mp4
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: