React-router app deployed on different locations (subdirectories)
问题 I have a react-router app that I have to deploy on different locations (subdirectories), so the basename would change. For example it should have the following paths: / (production) /appname/env1 /appname/env2 I want to use Browser History, so I implemented the BrowserRouter from react-router, but I cannot pass to it a static basename. And obviously the routing won't work, for example if I don't pass any basename to BrowserRouter , if my homepage route is: <Route path="/" exact component=