title: Router basename is not able to match the URL because it does not start with the basename
body: <p>After upgrading to React Router v6, my application stopped working and I failed to find a way to achieve the same behavior with version 6.</p>
  <p>This is the version I upgraded to: <code>react-router-dom</code> <code>6.2.1</code>.</p>
  <p>This is the code that worked with the previous version <code>5.2.0</code>:</p>
  <pre><code>&lt;Router basename=&quot;/#&quot;&gt;
    &lt;Route path=&quot;/login&quot;&gt;
      &lt;Login /&gt;
    &lt;/Route&gt;
    &lt;Route path=&quot;/&quot;&gt;
      &lt;Home /&gt;
    &lt;/Route&gt;
  &lt;/Router&gt;
  
              
  &lt;Link to=&quot;/login&quot;&gt;Login&lt;/Link&gt;
  </code></pre>
  <p>And I navigate to <code>http://localhost:3000/#/login</code>. Now even <code>http://localhost:3000</code> doesn't work.</p>
  <p>This is the full error I get in the browser console:</p>
  <p><em>&lt;Router basename=&quot;/#&quot;&gt; is not able to match the URL &quot;/&quot; because it does not start with the basename, so the &lt;Router&gt; won't render anything.</em></p>
  <p>I've read all I can find on StackOverflow, in the Github issues, the migration guide, tried a number of workarounds, but nothing seems to achieve the old behavior. It's like the v6 doesn't respect URL fragments at all.</p>
  <p>I need the URL fragments so that when a user refreshes a page or bookmarks a URL, it actually works.</p>
  <p>How to make this work with React Router v6?</p>