Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

href() builder produces invalid URL on optional segments #13055

Open
cloudkite opened this issue Feb 19, 2025 · 0 comments
Open

href() builder produces invalid URL on optional segments #13055

cloudkite opened this issue Feb 19, 2025 · 0 comments
Assignees
Labels

Comments

@cloudkite
Copy link

cloudkite commented Feb 19, 2025

I'm using React Router as a...

Framework

Reproduction

Given that i have a route in routes.ts as :

    route(
      "task/:taskId/v?/:versionId?",
      "task.route.tsx",
    ),

System Info

react-router v7.2

Used Package Manager

npm

Expected Behavior

href("task/:taskId/v?/:versionId?", { taskId: "123" }) === "task/123"
href("task/:taskId/v?/:versionId?", { taskId: "123", versionId: "hello" }) === "task/123/v/hello"

Actual Behavior

href("task/:taskId/v?/:versionId?", { taskId: "123" }) === "task/123/v?"
href("task/:taskId/v?/:versionId?", { taskId: "123", versionId: "hello" }) === "task/123/v?/hello"

@cloudkite cloudkite added the bug label Feb 19, 2025
@cloudkite cloudkite changed the title new href builder produces invalid URL on optional segments href() builder produces invalid URL on optional segments Feb 19, 2025
@pcattori pcattori self-assigned this Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants