-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Fix(react-router): Correct href() to processes routes that have an extension after the parameter or are a single optional parameter #13797
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
Conversation
🦋 Changeset detectedLatest commit: 4997ef8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳 |
e1316f4
to
3253ada
Compare
3253ada
to
5401bf0
Compare
@pcattori Do you have feedback for how I implemented this fix to |
fcc3707
to
f4b7fd9
Compare
f4b7fd9
to
179b526
Compare
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
Fixes #13795 and supersedes #13613
It is possible to have routes with an extension (
/:id.txt
) or with a single optional parameter (/:lang?
).href()
did not handle those cases correctly.This fixes that with an implementation of
href()
that more closely resembles howcompilePath()
handles the path.For a demonstration of the issue, see the
bug-report-test.ts
in #13795 or this example project.