title: How to use react-router BrowserRouter in a static index.html file
body: <p>I'm attempting to use the static index.html file generated by npm run build, along with react-router. the tl;dr is; i do not want a client server, I want the app to be loaded by opening the index.html file located in the build folder and still have BrowserRouter be able to route between components. At the moment, the page will load the 'home' component if I exclude the 'exact' prop in the route path, meaning it knows that it's out there somewhere, I just don't know how to configure the router to know that 'C:/Users/Myself/Project/app/build/index.html' is equal to the path of '/' and route to each component thereafter. if the exact prop is included, it just loads the standard 404 component. How should i configure the BrouserRouter basename, and/or the package.json "homepage" in order to route to the index.html-> load 'home' component when the page is initially opened?</p>
  
  <p>things I do not want to do: 
      - serve the build folder.
      - configure webpack
      - have the app accessible from '<a href="http://localhost:XXXX" rel="noreferrer">http://localhost:XXXX</a>'
      - change to use HashRouter (I want access to props.history.push)</p>
  
  <p>In my mind, if the app can show the 'home'component without specifying exact, it means that it can reach it under certain circumstances, and i'm just not specifying what the index path is properly, i.e it is somewhere out there at like ../project/build/index.html/somewhere</p>
  
  <p>I have already configured the package.json to have "homepage": ".", and have specified the BrowserRouter basename={'/build'}</p>
  
  <p>My BrowserRouter:</p>
  
  <pre><code>&lt;BrowserRouter basename={'/build'}&gt;
     &lt;Routes /&gt;
  &lt;/BrowserRouter&gt;
  </code></pre>
  
  <p>My routes.js file:</p>
  
  <pre><code>const Routes = (props) =&gt; {
    return (
      &lt;div&gt;
        &lt;Switch&gt;
          &lt;Route path={routes.HOME} component={Home} /&gt;
          &lt;Route render={(props) =&gt; &lt;div&gt;404 - Not Found&lt;/div&gt;} /&gt;
        &lt;/Switch&gt;
  
      &lt;/div&gt;
    )
  }
  </code></pre>
  
  <p>my package.json:</p>
  
  <pre><code>{
    "name": "cra",
    "version": "0.1.0",
    "private": true,
    "homepage": ".",
    "dependencies": {
      "react": "^16.8.6",
      "react-dom": "^16.8.6",
      "react-redux": "^7.0.2",
      "react-router-dom": "^5.0.0",
      "react-scripts": "2.1.8",
      "redux": "^4.0.1",
      "redux-logger": "^3.0.6",
      "redux-thunk": "^2.3.0"
    },
    "scripts": {
      "start": "react-scripts start",
      "build": "react-scripts build",
      "test": "react-scripts test",
      "eject": "react-scripts eject"
    },
    "eslintConfig": {
      "extends": "react-app"
    },
    "browserslist": [
      "&gt;0.2%",
      "not dead",
      "not ie &lt;= 11",
      "not op_mini all"
    ],
    "devDependencies": {
      "node-sass": "^4.11.0"
    }
  }
  </code></pre>
  
  <p>I want the end result to set c:/users/myself/project/app/build/index.html to equal route 'home' ('/').</p>
  
  <p>I'm willing to accept that this is not possible, but as stated above, being able to access it from an inexact path leads me to believe i can make it exact and am just messing up the route config</p>