title: Routing doesn't work as expected after building a react app using yarn build
body: <p>I build a react app, created the routing file and it works as expected when I run the app using <code>yarn start</code>, but when I tried to build the project in order to deploy it as a static component and run it using
  <code>npx serve -l 3000</code> , the routing didn't work as expected, it keeps giving me <code>404</code> when I hit any page other than the index one.</p>
  <pre><code>The project was built assuming it is hosted at /.
  You can control this with the homepage field in your package.json.
  
  The build folder is ready to be deployed.
  You may serve it with a static server:
  
    yarn global add serve
    serve -s build
  </code></pre>
  <pre><code>const Routes =  () =&gt; {
      return &lt;Router key=&quot;router&quot;&gt;
          &lt;Switch key=&quot;swith-router&quot;&gt;
              &lt;Route exact path=&quot;/&quot; key=&quot;a&quot;&gt;
                 ...
              &lt;/Route&gt;
              &lt;Route path=&quot;/b&quot; key=&quot;b&quot;&gt;
                  ...
              &lt;/Route&gt;
              &lt;Route path=&quot;/c&quot; key=&quot;c&quot;&gt;
                  ...
              &lt;/Route&gt;
              &lt;Route path=&quot;/d&quot; key=&quot;d&quot;&gt;
                 ...
              &lt;/Route&gt;
              &lt;Route path=&quot;/e&quot; key=&quot;e&quot;&gt;
                  ...
              &lt;/Route&gt;
          &lt;/Switch&gt;
      &lt;/Router&gt;
  };
  
  export default Routes;
  
  </code></pre>