Skip to content

useQueryState causes a navigation to trailing slash with search param w/ TanStack Router #1215

@mirshko

Description

@mirshko

Context

What's your version of nuqs?

  "name": "nuqs-bug",
    "nuqs": "^2.7.3",

What framework are you using?

TanStack Router

Which version of your framework are you using?

    "@tanstack/react-devtools": "^0.7.0",
    "@tanstack/react-router": "^1.132.0",
    "@tanstack/react-router-devtools": "^1.132.0",
    "@tanstack/router-plugin": "^1.132.0",

Description

When using useQueryState (or others) and calling the set(param) function, it causes a navigation, appending a trailing slash to the current route.

Expected behavior is that it doesn't cause a route transition with the path and only updates the query parameters.

Reproduction

https://codesandbox.io/p/github/mirshko/nuqs-bug/main?import=true

you can test it easier on the the second page, click "To Second Page Test" in preview window.

Metadata

Metadata

Assignees

No one assigned

    Labels

    adapters/tanstack-routerUses the TanStack Router adapterbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions