Skip to content

The onLoad event will not be triggered by the router object when the page is loaded for the first time #3676

@ilxqx

Description

@ilxqx

Which project does this relate to?

Router

Describe the bug

The onLoad event will not be triggered by the router object when the page is loaded for the first time. However, the onLoad event is correctly triggered when switching to the routing page later.

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-cooeyhbd?file=src%2Fmain.tsx

Steps to Reproduce the Bug or Issue

  1. Go to the link to reproduce the issue
  2. The issue should be visible on the first load, with the NProgress progress bar spinning at the top, because the onLoad event was not triggered
  3. Clicking the Home or About links on the top to switch routes will end the progress bar normally, because the router object successfully triggered the onLoad event
  4. To reproduce the issue again, you can click the refresh icon above
Image

Expected behavior

The onLoad event is correctly triggered on the first load.

Screenshots or Videos

No response

Platform

  • OS: macOS
  • Browser: Chrome
  • Version: 1.112.17

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions