1

I am using react-router 2.0 in my universal react app. Navigation trough the Link component works but when I paste the url manually nothing happens(browser hangs). How can I fix this issue? This is the router code:

<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>
bier hier
  • 20,970
  • 42
  • 97
  • 166
  • I assume that you use browserHistory and in that case, https://stackoverflow.com/questions/40332753/react-webpack-dev-server-cannot-get/40338808#40338808 may help you – Shubham Khatri Jul 05 '17 at 08:16

1 Answers1

-1

try this in your routes

add "/" in all routes like this

<Route path="/about" component={About}/>
Arshmeet
  • 316
  • 1
  • 8