Skip to content

[Bug]: Optional path parameter not working #8554

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

Closed
themgoncalves opened this issue Jan 4, 2022 · 1 comment
Closed

[Bug]: Optional path parameter not working #8554

themgoncalves opened this issue Jan 4, 2022 · 1 comment
Labels

Comments

@themgoncalves
Copy link

What version of React Router are you using?

6.2.1

Steps to Reproduce

<Routes>
      <Route path="/:lang?" element={<App />} />
</Routes>

Expected Behavior

Optional path to work and render target component.

Both paths should match.

/en
/

Actual Behavior

Optional path not working, that was a breaking change on the v6.

The question mark ? to mark an optional parameter breaks the framework.

@Haraldson
Copy link

Haraldson commented Jan 4, 2022

This is not a bug, but a conscious decision; see #8381, #8254 and #7285.

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

3 participants