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

[Bug]: regression for URL dynamic segments only replaced if prefixed by / #10669

Closed
zanona opened this issue Jul 5, 2023 · 1 comment
Closed
Labels

Comments

@zanona
Copy link

zanona commented Jul 5, 2023

What version of React Router are you using?

6.14.1

Steps to Reproduce

This seems to be a regression introduced at v6.5.0 where paths with dynamic segments simply stopped being correctly parsed if the dynamic segment is not prefixed by a forward slash '/'

in example:

generatePath("/news-:category", { category: "press" })

// output latest
// /news-:category

// output v6.4.5
// /news-press

Expected Behavior

generatePath("/news-:category", { category: "press" })  // -> /news-press

Actual Behavior

generatePath("/news-:category", { category: "press" })  // -> /news-:category
@zanona zanona added the bug label Jul 5, 2023
@zanona
Copy link
Author

zanona commented Jul 5, 2023

closed as intended behaviour as described under #9506

although this felt like a breaking change, which was my case.

@zanona zanona closed this as completed Jul 5, 2023
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

1 participant