Describe the bug#
Urls with hashes not scrolling to correct section when using lazy file routes. This occurs any time the page is fully rerendered (e.g. on reload and when accessing a link with a hash in a new tab). Works as expected with normal (non-lazy) file routing.
Your Example Website or App#
https://stackblitz.com/edit/github-4rybtq
Steps to Reproduce the Bug or Issue#
- Run the stackblitz example
- Paste https://stackblitz.com/edit/github-4rybtq/#section into a new tab
- Click "connect" if needed
- Notice how even though the #section tag is appended to the url, the section is not scrolled to.
Expected behavior#
Regardless of whether the route is lazy loaded or not, I would expect that when accessing a url with a section, the DOM element with the corresponding id is scrolled to.
Screenshots or Videos#
No response
Platform#
- OS: Windows
- Browser: Chrome
Additional context#
No response
This also doesn't seem to work every with the
<ScrollRestoration />component.