react-router icon indicating copy to clipboard operation
react-router copied to clipboard

[Bug]: Ignoring encoded hash (#) from the URL

Open vk-detrans opened this issue 1 year ago • 2 comments

What version of React Router are you using?

6.22.1

Steps to Reproduce

Given sandbox examples on how it works from 6.22.1 (tested latest 6.22.3).

When the user is in https://rgd377.csb.app/39%2310/ and clicks "next" (which is ./next), the linked path turns /39/next which was not the case until v6.22.0.

If this is expected behaviour or fixing some bug, let me know. Currently we have to revert the app to use v6.22.0.

Expected Behavior

When the url path name contains the encoded characters, while navigating using to="./next-page" or navigate('./next-page', the path name should not be broken.

code sandbox

Actual Behavior

code sandbox

vk-detrans avatar Mar 21 '24 12:03 vk-detrans

We are also experiencing this issue, due to url segments that include an encoded # character. Our current workaround is to specify the full path for links where this can happen (to value begins with a /), instead of using specifying paths relative to the parent route.

jhroemer avatar Aug 23 '24 08:08 jhroemer