0
我在我的通用反應應用程序中使用react-router 2.0。導航通過鏈接組件的作品,但當我手動粘貼的網址沒有任何反應(瀏覽器掛起)。我該如何解決這個問題?這是路由器代碼:爲什麼react-routing不能直接在瀏覽器中工作?
<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>
所有路由我假設你使用browserHistory在這種情況下,HTTPS: //stackoverflow.com/questions/40332753/react-webpack-dev-server-cannot-get/40338808#40338808可以幫助你 –