router
router copied to clipboard
Routes with lazy and those with loader async do not set view to elementet id after refresh
Describe the bug
Routes with lazy and those with loader async do not set view to elementet id after refresh. When it is on the path to a specific element with id
files .lazy, loader: async () => {},
Your Example Website or App
https://stackblitz.com/edit/vitejs-vite-rz7exv
Steps to Reproduce the Bug or Issue
- Go to Form (lazy) or Post (async loader)
- Click on Test link which leads to an element with id
- Refresh the site (The side inside the sandbox, not the entire sandbox)
Expected behavior
I would expect the viewer's view to be set on the element the link points to as it is on paths without lazy
Screenshots or Videos
https://github.com/user-attachments/assets/38969708-9927-4872-83ca-1141fd71975b
Platform
- OS: [e.g. macOS, Windows, Linux]
- Browser: [e.g. Chrome, Safari]
- Version: [e.g. 91.1]
Additional context
No response
seems to be a duplicate of https://github.com/TanStack/router/issues/2014, but #2014 does not mention the loader issue
Completed with https://github.com/TanStack/router/releases/tag/v1.98.1.