Skip to content

Can't track "global" URL params #423

@Moshyfawn

Description

@Moshyfawn

Describe the bug

There's no way to track current URL parameters in a "root" layout / route. useNearestMatch isn't updated and useMatch({ strict: false }) doesn't "track" parameters updates in nested routes.

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-csfaug?file=src/main.tsx

Steps to Reproduce the Bug or Issue

  1. Open StackBlitz sandbox
  2. Click any "Even Deeper" link
  3. See the issue: URL parameters values display undefined in the "layout" component (/layout)

Expected behavior

As a user, I expected to be able to "track" URL params in general: however nested the route is, if there's a parameter in the URL, I want to be able to "react" to it's change. Currently, don't see a way to achieve the desired behaviour

Screenshots or Videos

No response

Platform

  • OS: macOS
  • Browser: Firefox
  • 108.0b9

Additional context

{
  "@tanstack/react-router": "0.0.1-beta.30",
  "@tanstack/react-router-devtools": "0.0.1-beta.30"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions