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]: Upgrading from v5 hashType="noslash"? #11076

Closed
Lugribossk opened this issue Dec 1, 2023 · 2 comments
Closed

[Bug]: Upgrading from v5 hashType="noslash"? #11076

Lugribossk opened this issue Dec 1, 2023 · 2 comments
Labels

Comments

@Lugribossk
Copy link

What version of React Router are you using?

6.20.0

Steps to Reproduce

I'm trying to upgrade a project that uses react-router-dom v5.3.4 to v6.20.0. It uses <HashRouter hashType="noslash"> for the router. I can't seem to find a way to configure createHashRouter to behave in the same way where the routes do not have a leading slash.
Is this a breaking change in v6? It's not mentioned in the v5 upgrade guide or the changelog for v6.
And no, changing the routes is not an option at this point.

Expected Behavior

Some option to be able to continue using hash routes without a leading slash.

Actual Behavior

Routes suddenly have a leading slash.

@Lugribossk Lugribossk added the bug label Dec 1, 2023
@timdorr
Copy link
Member

timdorr commented Dec 1, 2023

This is a side effect first of upgrading to history 5 (which doesn't have this option) and then internalizing the history management in @remix-run/router.

There is no plan to support this prior behavior. If you need it, I would stick with React Router 5.

@timdorr timdorr closed this as not planned Won't fix, can't repro, duplicate, stale Dec 1, 2023
@Lugribossk
Copy link
Author

Oh that's a shame. Especially that it isn't called out in the upgrade guide as a breaking (and unfixable!) change.

v-viyada added a commit to microsoft/accessibility-insights-action that referenced this issue Mar 6, 2024
…tes (#2028)

#### Details

react-router-dom is used for test website for testing Urls with hash
fragments.
The feature hashType="noslash" used in test website is not supported
from v6. Please refer
remix-run/react-router#11076 for more details.
As per this, this feature is not going to be supported in future version
so we have to stick with v5 only

Also closed out dependabot PR
#2024

##### Motivation

<!-- This can be as simple as "addresses issue #123" -->

##### Context

<!-- Are there any parts that you've intentionally left out-of-scope for
a later PR to handle? -->

<!-- Were there any alternative approaches you considered? What
tradeoffs did you consider? -->

#### Pull request checklist
<!-- If a checklist item is not applicable to this change, write "n/a"
in the checkbox -->
- [n/a] Addresses an existing issue: Fixes #0000
- [n/a] Added relevant unit test for your changes. (`yarn test`)
- [n/a] Verified code coverage for the changes made. Check coverage
report at: `<rootDir>/test-results/unit/coverage`
- [x] Ran precheckin (`yarn precheckin`)
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