router icon indicating copy to clipboard operation
router copied to clipboard

Can't navigate with Memory History Router

Open pakholeung37 opened this issue 2 years ago • 2 comments

Describe the bug

Cannot use 'Link', 'navigate.to', or any other navigation method with the createMemoryHistory API. Btw, will tanstack router supports nested routers? It would be great if it has a example. https://github.com/remix-run/react-router/issues/7375

Your Example Website or App

Steps to Reproduce the Bug or Issue

Simply adding a memoryHistory to the router history parameter will reproduce the issue.

Expected behavior

https://codesandbox.io/p/sandbox/wnq10opj68?file=%2Fsrc%2Findex.js react router support.

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]

Additional context

No response

pakholeung37 avatar Dec 26 '23 09:12 pakholeung37

Looks related to this unit test issue: https://discord.com/channels/719702312431386674/1186441342465867867/1186441342465867867

Reproduced in unit tests here: https://stackblitz.com/edit/stackblitz-starters-jqjpjm

mer10z avatar Dec 27 '23 01:12 mer10z

@tannerlinsley I tried 1.0.5,memory history will trigger onUpdate when trigger pushState api. But go, replace, back, forward api will not. memory history doesn't have popStateEvent or pushStateEvent.

https://github.com/TanStack/router/assets/16984253/9b75ddea-ac42-48fe-b408-4ad2e472f7bb

reproduce https://github.com/pakholeung37/tanstack-router-bug-report

pakholeung37 avatar Dec 29 '23 02:12 pakholeung37