title: Routes are not defined in react build : react-router-dom v6
body: <pre><code>&lt;Router&gt;
   &lt;Routes&gt;
    &lt;Route path=&quot;/login&quot; element={&lt;Login /&gt;} /&gt;
    &lt;Route path=&quot;/&quot; element={&lt;Dashboard /&gt;} /&gt;
    &lt;Route path=&quot;*&quot; element={&lt;h2&gt;Page not found&lt;/h2&gt;} /&gt;
   &lt;/Routes&gt;
  &lt;/Router&gt;
  </code></pre>
  <p>this is how i have defined the routes in v6, this works perfect in development, but in build version only index route that is &quot;/&quot; loads, and others routes dont work saying : The requested path cannot be found.
  <a href="https://i.stack.imgur.com/I6pO9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I6pO9.png" alt="enter image description here" /></a></p>
  <p>screenshot is of build version</p>