我在我的通用反应应用程序中使用 react-router 2.0。通过 Link 组件导航可以工作,但是当我手动粘贴 url 时没有任何反应(浏览器挂起)。我该如何解决这个问题?这是路由器代码:
<Route path="/" component={App}>
{ /* Home (main) route */ }
<IndexRoute component={Home}/>
{ /* Routes requiring login */ }
<Route onEnter={requireLogin}>
<Route path="chat" component={Chat}/>
<Route path="loginSuccess" component={LoginSuccess}/>
</Route>
{ /* Routes */ }
<Route path="about" component={About}/>
<Route path="login" component={Login}/>
<Route path="pagination" component={Pagination}/>
<Route path="survey/:user" component={Survey}/>
<Route path="widgets" component={Widgets}/>
<Route path="search" component={Search}/>
<Route path="make/model/:id" component={Details}/>
{ /* Catch all route */ }
<Route path="*" component={NotFound} status={404} />
</Route>