-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Open
Description
I'm using React Router as a...
library
Reproduction
Version: react-router-dom 6.27.0
Sandbox: https://codesandbox.io/p/devbox/mutable-framework-4l8645-forked-vq3pdx
Steps to reproduce:
- Go to the sandbox and click nested path with a'bc\d/e#f//g_

- Notice how we show "whatever - name: "a'bcd/e#f//g_"

- Click "relative link after surrounding spaces: whatever" which is defined as
<Link to="./whatever">
. Notice how the URL changes fromhttps://vq3pdx.csb.app/foos/foo/a'bcd%2Fe%23f%2F%2Fg_/whatever
tohttps://vq3pdx.csb.app/foos/foo/a'bcd%2Fe/whatever

System Info
System:
OS: macOS 15.3.1
CPU: (10) arm64 Apple M1 Max
Memory: 1.56 GB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.18.0 - /usr/local/bin/node
Yarn: 4.3.1 - /opt/homebrew/bin/yarn
npm: 9.8.1 - /opt/homebrew/bin/npm
pnpm: 8.13.1 - /opt/homebrew/bin/pnpm
Browsers:
Brave Browser: 118.1.59.117
Chrome: 133.0.6943.127
Edge: 133.0.3065.69
Safari: 18.3
npmPackages:
vite: ^6.0.11 => 6.0.11
Used Package Manager
yarn
Expected Behavior
In step 3 of steps to reproduction, the URL should be https://vq3pdx.csb.app/foos/foo/a'bcd%2Fe%23f%2F%2Fg_/whatever
Actual Behavior
The URL becomes https://vq3pdx.csb.app/foos/foo/a'bcd%2Fe/whatever
. Interestingly enough, if you remove the hashtag from the URI component a'bc\d/ef//g_
, you get the correct behavior