-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Describe the bug
We have encountered an issue with data prefetching in our application utilizing @tanstack/react-query version 5.8.7 and @tanstack/react-router version ^1.0.5. The core of the problem lies in the application’s behavior when employing the defaultPreload: 'intent' flag to enable link hover prefetching. Specifically, upon prefetching data on hover, the entire page appears to reload, affecting even those components that are unrelated to the prefetching process, essentially reverting them to their initial state.
Your Example Website or App
Steps to Reproduce the Bug or Issue
- Enable data prefetching with defaultPreload: 'intent' in the @tanstack/react-router settings.
- Hover over a link that triggers data prefetching.
- Observe as the entire page resets to its initial state, including components unrelated to the preloaded route.
Expected behavior
Data prefetching on hover should only refresh the data and components directly associated with the preloaded route without causing a full page reload or affecting unrelated components.
Screenshots or Videos
example.mov
Platform
- @tanstack/react-query version: 5.8.7
- @tanstack/react-router version: ^1.0.5
- Browser: Chrome (latest stable version)
- Operating System: macOS
Additional context
We have attached a video demonstrating the described behavior for a clearer understanding of the issue.