Skip to content

Conversation

brophdawg11
Copy link
Contributor

Absolute URL detection in <Link to> missed a case where the object form of to was used without a pathname, and resulted in the loss of the active pathname

Closes #10007

@changeset-bot
Copy link

changeset-bot bot commented Feb 2, 2023

🦋 Changeset detected

Latest commit: 39eecea

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
react-router-dom Patch
react-router Patch
react-router-dom-v5-compat Patch
react-router-native Patch

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

Comment on lines +424 to +428
if (
isBrowser &&
typeof to === "string" &&
/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(to)
) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All absolute logic now only happens when to is a string and we use to unaltered as we did before in useHref and useLinkClickHandler for non-absolute URLs

Co-authored-by: Logan McAnsh <logan@remix.run>
@brophdawg11 brophdawg11 merged commit b620be2 into dev Feb 2, 2023
@brophdawg11 brophdawg11 deleted the brophdawg11/fix-partial-link-to branch February 2, 2023 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants