What works is going to an id hash if you're already on the right page. This can be shown in the demo by clicking to "About" link (the normal A link), and then the memo router button with /about#hash title)
Nothing else works how I expect it to.
The navigation can be fixed by triggering the listeners inside set i.e. right over the if (scroll), but I still can't make a page change AND do the scroll to the id hash in one button click.
Expected behavior
I'd expect to be able to use set to move between pages, since there's no alternative API than:
Describe the bug
While writing docs for MemoryRouter, I got a bit concerned that the MemoryRouter might be entirely broken.
The
set
function in the MemoHistory appear to not be working as expected.Using the
set
I expected to be able to do either of these:Your Example Website or App
https://stackblitz.com/edit/github-xo9s9c-ljydbz?file=src%2Fapp.tsx
Steps to Reproduce the Bug or Issue
See description.
What works is going to an id hash if you're already on the right page. This can be shown in the demo by clicking to "About" link (the normal A link), and then the memo router button with /about#hash title)
Nothing else works how I expect it to.
The navigation can be fixed by triggering the listeners inside
set
i.e. right over theif (scroll)
, but I still can't make a page change AND do the scroll to the id hash in one button click.Expected behavior
I'd expect to be able to use
set
to move between pages, since there's no alternative API than:get, set, listen, go/back/forward
Screenshots or Videos
No response
Platform
but also stackblitz
Additional context
No response