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

[Bug]: URI parameter decoding issue in 6.0.0-beta.5 #8072

Closed
davidferguson opened this issue Sep 25, 2021 · 1 comment
Closed

[Bug]: URI parameter decoding issue in 6.0.0-beta.5 #8072

davidferguson opened this issue Sep 25, 2021 · 1 comment
Labels

Comments

@davidferguson
Copy link

What version of React Router are you using?

v6

Steps to Reproduce

In 6.0.0-beta.5, there is an issue decoding url parameters. The following code works on 6.0.0-beta.4, but not 6.0.0-beta.5.

import React from 'react'
import ReactDOM from 'react-dom'
import { BrowserRouter, Routes, Route, Navigate, Outlet } from 'react-router-dom'

const ContentRoutes = (): JSX.Element => (
  <Routes>
    <Route index element={<Navigate to='%2F' replace />} />
    <Route path=':id' element={<h3>got a match!</h3>} />
  </Routes>
)

const App = (): JSX.Element => (
  <BrowserRouter>
    <Routes>
      <Route path='/' element={<><h1>App Layout</h1><Outlet /></>}>
        <Route index element={<Navigate to='content' replace />} />
        <Route path='content/*' element={<ContentRoutes />} />
        <Route path='*' element={<h2>Not Found</h2>} />
      </Route>
    </Routes>
  </BrowserRouter>
)

ReactDOM.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>,
  document.getElementById('root')
)

Expected Behavior

Upon load, the page should redirect to /content and then /content/%2F, and then display the text <h3>got a match!</h3>. This works under 6.0.0-beta.4.

Actual Behavior

On 6.0.0-beta.5, the redirects work but the text <h3>got a match!</h3> is not displayed.

@mjackson mjackson added the bug label Oct 5, 2021
mjackson added a commit that referenced this issue Oct 7, 2021
Fixes #8072
Fixes REM-258
Fixes REM-375
@mjackson
Copy link
Member

mjackson commented Oct 7, 2021

This was fixed in 8ccac66 (see the test in 8ccac66#diff-e7f12a4325edcc5b13898df439fcba964ca2e25f4a125e39d47ae3c284b656de). It should be released tomorrow in beta.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants