【发布时间】:2016-12-30 15:23:44
【问题描述】:
我在 IIS 中托管的 ASP.NET Web 窗体中有一个现有应用程序。现在我在根目录下创建了一个名为 mobile 的新目录。网址就像 - http://domainname/mobile。
应用程序是使用 React、Redux 和 React Router 编写的。现在运行应用程序,我在 Routes.js 中进行了如下更改 -
<Router history={history}>
<Route path='/mobile' component={App}>
<Route path='/thankyou' component={ThankYou} />
</Route>
</Router>
主页已正确加载,因为根组件的路径为“/mobile”。但是当我尝试使用指向thankyou的链接标签访问thankyou组件时。它没有用。
我尝试了各种更改 - 使用 react-router github 上提供的基本名称或历史记录或各种建议的解决方案,但这些也不起作用。我在 package.json 中的库版本
"react": "15.0.2",
"react-dom": "15.0.2",
"react-redux": "4.4.5",
"react-router": "2.4.0",
"react-router-redux": "4.0.4",
谁能提供一个将baseURL设置为“/mobile”的工作解决方案?
可能重复 - React Router
【问题讨论】:
标签: reactjs react-router