Skip to content
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

Using Unicode routes #6386

Closed
bragovo opened this issue Oct 10, 2018 · 1 comment
Closed

Using Unicode routes #6386

bragovo opened this issue Oct 10, 2018 · 1 comment

Comments

@bragovo
Copy link

bragovo commented Oct 10, 2018

Version

4.3.0

Steps to reproduce

const path = '/%D0%BF%D1%80%D0%B8%D0%BC%D0%B5%D1%80';

<NavLink to={path}>
  Posts
</NavLink>

<Switch>
  <Route path={path} component={Posts} />
</Switch>

Expected Behavior

Show Posts component.

Actual Behavior

Empty page.

Main problem

path and location.pathname looks like /%D0%BF%D1%80%D0%B8%D0%BC%D0%B5%D1%80 and /пример and does not match. In Route I can use <Route path={decodeURIComponent(path)} component={Posts} />. But fir NavLink I need encoded path for correct HTML code (can't decode it), but NavLink get location.pathname (decoded) from history and I can't encode it. So, NavLink never get active state. Only one way is set custom function to isActive, but its very uncomfortable.

@timdorr
Copy link
Member

timdorr commented Oct 10, 2018

This is caused by history under the hood. There's an open issue about it here: remix-run/history#505

@timdorr timdorr closed this as completed Oct 10, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Dec 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants