dimanche 22 janvier 2017

React Router - Nested Routes Not Rendering

I'm currently developing with ReactJS and I am trying to get my head around React Router and it was going well up until now, because for some reason my nested route will not render.

Basically when I navigate to '/home', I want the NavBar to render and the welcome message to be rendered underneath but for some reason only the NavBar is rendered, it forgets about rendering the welcome message. Where I am going wrong?

See code sample below.

Thanks.

ReactDOM.render((
  <Router history={hashHistory}>
    <Route path="/" component={Login}/>
    <Route path="/signup" component={Signup}/>
    <Route path="/companyregistration" component={CompanyRegistration}/>
    <Route path="/adduserdetails" component={AddUserDetails}/>
    <Route component={NavBar}>
      <Route path="/home" component={Welcome} />
    </Route>
  </Router>
), document.getElementById("app"))




Aucun commentaire:

Enregistrer un commentaire