-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
Describe the bug
Noticed this after another fix for the routers history back and go functions (#1407)
useMatchRoute hook isn't behaving consistently between In memory router and the standard router. For the in memory router useMatchRouter wrongfully returns a match where it would behave as expected in the standard use of the router.
I've create created an example that should only show a back button when not on the home/root page
Your Example Website or App
In memory example on Codesandbox
Steps to Reproduce the Bug or Issue
In memory example on Codesandbox
- Click on the about page - the back button should appear
- Click back and the page should navigate to the home page and but the back isn't removed
- Also, after clicking back any other attempts to navigate between the about page and the home page no longer remove the back button. Also after clicking back using the home and about links in the example can require two clicks
Expected behavior
Here is how it currently works on the standard router for the browser
standard router example on Codesandbox
- Click on the about page - the back button should appear
- Click back and the page should navigate to the home page and back button is no longer visible
- After clicking back, navigating between the home and about sections should only require 1 click on there respective links
Screenshots or Videos
No response
Platform
- OS: macOS 13.3.1 (22E261)
- Browser: Chrome Version 123.0.6312.59 (Official Build) (arm64)
- Version: @tanstack/react-router: ^1.26.1
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels