我正在为我的反应应用程序使用反应路由器(createBrowserHistory)。
下面是我的代码
var ReactDOM = require('react-dom') ;
var ReactRouter = require('react-router');
var Router = ReactRouter.Router;
var Route = ReactRouter.Route;
var Link = ReactRouter.Link;
var browserHistory = require('react-router');
var createBrowserHistory = require('history/lib/createBrowserHistory');
var CL = require('./page1/1.jsx');
var Validation = require('./page3/3.jsx');
var Infos = require('./page4/4.jsx');
var Confirm = require('./page7/7.jsx');
var Upload = require('./page8/8.jsx');
module.exports = (
<Router history={new createBrowserHistory()}>
<Route path='/' component={CL}></Route>
<Route path='/validation' component={Validation}></Route>
<Route path='/infos' component={Infos}></Route>
<Route path='/confirm' component={Confirm}></Route>
<Route path='/upload' component={Upload}></Route>
</Router>
)
Wen 在本地运行 IIS,我在浏览器上访问 localhost,我可以获取“CL”组件并在页面上显示,但是,如果我转到 /validation,我会得到
Failed to load resource: the server respond with status of 404 (Not Found)
任何人都知道需要添加到 IIS 或我的 js 代码以使此路由工作吗?