Skip to content

using React.StrictMode breaks the useMatchRoute hook #1569

@DNR500

Description

@DNR500

Describe the bug

The useMatchRoute hook no longer seems to be working as of version 1.31.17

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-in-browser-njf6lw-wyq9aw-ke3ssm?file=package.json

Steps to Reproduce the Bug or Issue

In browser example is here - https://stackblitz.com/edit/tanstack-router-in-browser-njf6lw-wyq9aw-ke3ssm?file=package.json

  1. Click on Component About
  2. A back button should appear but doesn't display

Note: this appears to be broken for both for the in browser router and the in memory router - example of broken in memory version is here https://stackblitz.com/edit/tanstack-router-in-memory-njf6lw-thk9ow?file=package.json

Expected behavior

This worked in versions older than 1.31.17

example of 1.31.8 here - https://stackblitz.com/edit/tanstack-router-in-browser-njf6lw-wyq9aw?file=package.json

  1. Click on Component About
  2. A back button is shown
  3. Click on the Component home
  4. The back button is hidden

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.31.17

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions