Closed
Description
What version of React Router are you using?
6.23.0
Steps to Reproduce
You can try it here: https://stackblitz.com/edit/github-mfpcog-zdd21p?file=src%2FApp.tsx
Or use this code:
export default function App() {
return (
<div>
<Routes>
<Route path="/user/:username" element={<Username />}></Route>
</Routes>
</div>
);
}
const Username = () => {
const params = useParams();
const match = useMatch('/user/:username');
return (
<div>
hello {params.username} vs {match?.params.username}
</div>
);
};
Expected Behavior
I would expect useMatch
to decode params the same as useParams
does.
If I call this URL /user/bücherwurm
of the example above, I would expect the following output:
hello bücherwurm vs bücherwurm
Actual Behavior
It looks like useMatch
does no more decode the URL Params.
The example above will output
hello bücherwurm vs b%C3%BCcherwurm
If you use 6.22.0 it works as expected, params are decoded by useMatch