I'm trying to implement hash links where clicking on a link like "/my-page#my-element" should navigate the user (scrolling if necessary) to the matching html (id="my-element") element on the "/my-page" route.
My current implementation using a Link component does not work reliably. I think it conflicts with the standard ScrollRestoration which scrolls the back to the top of the window on navigation.
I can add code on the given route to scrollTo that element once the route renders, but I want to avoid a double scroll "scroll up, then scroll down" user experience so I am curious if there is a way to opt out of the ScrollRestoration for this scenario?
Maybe I need to implement a custom ScrollRestoration instead of the standard ScrollRestoration exported from the library?