Skip to content

preload="intent" triggers navigations in route's beforeLoad handler #1382

@its-jman

Description

@its-jman

Describe the bug

Links to a route will trigger any navigation inside the beforeLoad handler, when preloading that route. This can be reliably resolved by disabling preloading.

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-zhwi16

Steps to Reproduce the Bug or Issue

Hover "about" link. It will navigate to "/third" without you clicking on the link

(about is a route with a beforeLoad which navigates to "/third". )

Expected behavior

preloading does not trigger navigation from the preloaded page

Screenshots or Videos

Screen.Recording.2024-03-27.at.10.52.38.AM.mov

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]

Additional context

Similar sounding previous issues, probably unrelated:
#1201
#1220

Metadata

Metadata

Assignees

No one assigned

    Labels

    has workaroundA solution has been provided.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions