Skip to content

Hovering over a link in a NotFoundComponent with preloadintent and no staletime #1220

@jmdeschenes

Description

@jmdeschenes

Describe the bug

When in a notFoundComponent, a <Link to='...'> will automatically load the page. Interestingly, if you use a button with a onClick: () => navigate('/')... Nothing happens

Your Example Website or App

https://stackblitz.com/edit/github-h4dx75?file=src%2Fmain.tsx

Steps to Reproduce the Bug or Issue

  1. Clink on the Invalid Link Button or enter an invalid link in the URL.
  2. Hover over the go back button
  3. The screen goes blank

If you comment either:

  1. defaultPreload: 'intent' or defaultPreloadStaleTime: 0, it works as expected. As a workaround you can set the link: <Link to='/' preload={false}>...</Link> and it should work as expected.

Expected behavior

As a user, I would expect that I can navigate when I click on a link.

Screenshots or Videos

No response

Platform

  • OS: Linux
  • Browser: Chrome
  • Version: 121.0.6167.160

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