title: React-router V-5.2.0 is not working when navigating away from homepage
body: <p><strong>index.tsx</strong></p>
  <pre><code>import {Router, } from 'react-router';
  import { createHashHistory } from 'history';
  
    const hashHistory = createHashHistory();
    hashHistory.push(&quot;/&quot;);
    ReactDOM.render(
      &lt;Provider {...stores}&gt;
        &lt;Router history={hashHistory} &gt;
            &lt;App /&gt;
        &lt;/Router&gt;
      &lt;/Provider&gt;,
      document.getElementById('root') as HTMLElement
    );
  </code></pre>
  <p><strong>App.tsx</strong></p>
  <pre><code>import Router from './components/Router';
    public render() {
      return &lt;Router/&gt;;
    }
  </code></pre>
  <p><strong>Router</strong></p>
  <pre><code>import { Route, Switch } from 'react-router';
  
  const Router = () =&gt; {
    const UserLayout = utils.getRoute('/user').component;
    const AppLayout = utils.getRoute('/').component;
    
    return (
      &lt;Switch&gt;
        &lt;Route path=&quot;/user&quot; render={(props: any) =&gt; &lt;UserLayout {...props} /&gt;} /&gt;
        &lt;Route path=&quot;/test&quot; render={() =&gt; &lt;div&gt;Test&lt;/div&gt;} /&gt;
        &lt;ProtectedRoute path=&quot;/&quot; render={(props: any) =&gt; &lt;AppLayout {...props} exact /&gt;} /&gt;
      &lt;/Switch&gt;
    );
  };
  </code></pre>
  <p><strong>Electron</strong></p>
  <pre><code>const electron = require('electron');
  const app = electron.app;
  const BrowserWindow = electron.BrowserWindow;
  const isDev = require('electron-is-dev');
  const path = require('path');
  const url = require('url');
  var history = require('connect-history-api-fallback');
  
  function createWindow() {
    mainWindow = new BrowserWindow({
      width: 1200,
      height: 800,
      nodeIntegration: true,
      webPreferences: {
        webSecurity: false
      }
    });
  
    mainWindow.loadURL(!isDev ? 'http://localhost:3000' : url.format({
      pathname: path.join(__dirname,'../build/index.html'),
      protocol: 'file:',
      slashes: true,
    }));
    
    mainWindow.webContents.openDevTools();
    mainWindow.on('closed', function () {
      mainWindow = null;
    });
  }
  
  app.on('ready', createWindow);
  app.on('ready', () =&gt; console.log('Ready', history({index: 'index.html'})));
  
  app.on('window-all-closed', function () {
    if (process.platform !== 'darwin') {
      app.quit();
    }
  });
  console.log('global window', __dirname);
  app.on('activate', function () {
    console.log('mainWindow', __dirname);
  
    if (mainWindow === null) {
      console.log('mainWindowNull', __dirname);
      createWindow();
    }
  });
  
  </code></pre>
  <p>I also tried using the 'react-router-dom' but it won't also work. This only happens in production.
  The homepage will load even if I reload it. But when I navigate away from the homepage for instance I click the login button it throws an error and the screen is white. In my network tab, it shows file:///D: in red. Also I'm not using Webpack.</p>